aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLAssembleInterface.cpp38
-rw-r--r--src/gpu/gl/GrGLBufferImpl.cpp36
-rw-r--r--src/gpu/gl/GrGLCaps.cpp12
-rw-r--r--src/gpu/gl/GrGLContext.cpp8
-rw-r--r--src/gpu/gl/GrGLCreateNativeInterface_none.cpp2
-rw-r--r--src/gpu/gl/GrGLCreateNullInterface.cpp10
-rw-r--r--src/gpu/gl/GrGLDefaultInterface_none.cpp2
-rw-r--r--src/gpu/gl/GrGLExtensions.cpp8
-rw-r--r--src/gpu/gl/GrGLFragmentProcessor.h2
-rw-r--r--src/gpu/gl/GrGLGpu.cpp68
-rw-r--r--src/gpu/gl/GrGLGpu.h6
-rw-r--r--src/gpu/gl/GrGLGpuProgramCache.cpp16
-rw-r--r--src/gpu/gl/GrGLIndexBuffer.cpp2
-rw-r--r--src/gpu/gl/GrGLInterface.cpp662
-rw-r--r--src/gpu/gl/GrGLNameAllocator.cpp18
-rw-r--r--src/gpu/gl/GrGLNoOpInterface.cpp6
-rw-r--r--src/gpu/gl/GrGLPath.cpp2
-rw-r--r--src/gpu/gl/GrGLPathRange.cpp2
-rw-r--r--src/gpu/gl/GrGLPathRendering.cpp14
-rw-r--r--src/gpu/gl/GrGLUtil.cpp12
-rw-r--r--src/gpu/gl/GrGLVertexArray.cpp2
-rw-r--r--src/gpu/gl/GrGLVertexArray.h2
-rw-r--r--src/gpu/gl/GrGLVertexBuffer.cpp2
-rw-r--r--src/gpu/gl/SkGLContext.cpp14
-rw-r--r--src/gpu/gl/SkNullGLContext.cpp16
-rw-r--r--src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp4
-rw-r--r--src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp8
-rw-r--r--src/gpu/gl/angle/SkANGLEGLContext.cpp4
-rw-r--r--src/gpu/gl/builders/GrGLFragmentShaderBuilder.h2
-rw-r--r--src/gpu/gl/builders/GrGLProgramBuilder.cpp18
-rw-r--r--src/gpu/gl/builders/GrGLProgramBuilder.h10
-rw-r--r--src/gpu/gl/builders/GrGLShaderBuilder.cpp2
-rw-r--r--src/gpu/gl/builders/GrGLShaderBuilder.h2
-rw-r--r--src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp2
-rw-r--r--src/gpu/gl/debug/GrBufferObj.h2
-rw-r--r--src/gpu/gl/debug/GrDebugGL.cpp32
-rw-r--r--src/gpu/gl/debug/GrDebugGL.h4
-rw-r--r--src/gpu/gl/debug/GrFrameBufferObj.h18
-rw-r--r--src/gpu/gl/debug/GrGLCreateDebugInterface.cpp40
-rw-r--r--src/gpu/gl/debug/GrTextureUnitObj.h2
-rw-r--r--src/gpu/gl/debug/SkDebugGLContext.h4
-rw-r--r--src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp4
-rw-r--r--src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp12
-rw-r--r--src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp8
-rw-r--r--src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp12
-rw-r--r--src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp2
-rw-r--r--src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp2
-rw-r--r--src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp16
-rw-r--r--src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp8
-rw-r--r--src/gpu/gl/mesa/SkMesaGLContext.cpp14
-rw-r--r--src/gpu/gl/mesa/SkMesaGLContext.h4
-rw-r--r--src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp2
-rw-r--r--src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp14
-rw-r--r--src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp30
54 files changed, 622 insertions, 622 deletions
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp
index adb11df809..f19a1cb075 100644
--- a/src/gpu/gl/GrGLAssembleInterface.cpp
+++ b/src/gpu/gl/GrGLAssembleInterface.cpp
@@ -16,13 +16,13 @@
const GrGLInterface* GrGLAssembleInterface(void* ctx, GrGLGetProc get) {
GET_PROC_LOCAL(GetString);
- if (NULL == GetString) {
- return NULL;
+ if (nullptr == GetString) {
+ return nullptr;
}
const char* verStr = reinterpret_cast<const char*>(GetString(GR_GL_VERSION));
- if (NULL == verStr) {
- return NULL;
+ if (nullptr == verStr) {
+ return nullptr;
}
GrGLStandard standard = GrGLGetStandardInUseFromString(verStr);
@@ -32,7 +32,7 @@ const GrGLInterface* GrGLAssembleInterface(void* ctx, GrGLGetProc get) {
} else if (kGL_GrGLStandard == standard) {
return GrGLAssembleGLInterface(ctx, get);
}
- return NULL;
+ return nullptr;
}
const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
@@ -40,9 +40,9 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
GET_PROC_LOCAL(GetStringi);
GET_PROC_LOCAL(GetIntegerv);
- // GetStringi may be NULL depending on the GL version.
- if (NULL == GetString || NULL == GetIntegerv) {
- return NULL;
+ // GetStringi may be nullptr depending on the GL version.
+ if (nullptr == GetString || nullptr == GetIntegerv) {
+ return nullptr;
}
const char* versionString = (const char*) GetString(GR_GL_VERSION);
@@ -50,12 +50,12 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
if (glVer < GR_GL_VER(1,5) || GR_GL_INVALID_VER == glVer) {
// We must have array and element_array buffer objects.
- return NULL;
+ return nullptr;
}
GrGLExtensions extensions;
if (!extensions.init(kGL_GrGLStandard, GetString, GetStringi, GetIntegerv)) {
- return NULL;
+ return nullptr;
}
GrGLInterface* interface = new GrGLInterface();
@@ -266,7 +266,7 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
} else {
// we must have FBOs
delete interface;
- return NULL;
+ return nullptr;
}
if (extensions.has("GL_NV_path_rendering")) {
@@ -469,22 +469,22 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) {
GET_PROC_LOCAL(GetString);
- if (NULL == GetString) {
- return NULL;
+ if (nullptr == GetString) {
+ return nullptr;
}
const char* verStr = reinterpret_cast<const char*>(GetString(GR_GL_VERSION));
GrGLVersion version = GrGLGetVersionFromString(verStr);
if (version < GR_GL_VER(2,0)) {
- return NULL;
+ return nullptr;
}
GET_PROC_LOCAL(GetIntegerv);
GET_PROC_LOCAL(GetStringi);
GrGLExtensions extensions;
if (!extensions.init(kGLES_GrGLStandard, GetString, GetStringi, GetIntegerv)) {
- return NULL;
+ return nullptr;
}
GrGLInterface* interface = new GrGLInterface;
@@ -670,10 +670,10 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) {
GET_PROC(PushGroupMarker);
GET_PROC(PopGroupMarker);
// The below check is here because a device has been found that has the extension string but
- // returns NULL from the eglGetProcAddress for the functions
- if (NULL == functions->fInsertEventMarker ||
- NULL == functions->fPushGroupMarker ||
- NULL == functions->fPopGroupMarker) {
+ // returns nullptr from the eglGetProcAddress for the functions
+ if (nullptr == functions->fInsertEventMarker ||
+ nullptr == functions->fPushGroupMarker ||
+ nullptr == functions->fPopGroupMarker) {
extensions.remove("GL_EXT_debug_marker");
}
}
diff --git a/src/gpu/gl/GrGLBufferImpl.cpp b/src/gpu/gl/GrGLBufferImpl.cpp
index 0e2990e7f9..52ef946cff 100644
--- a/src/gpu/gl/GrGLBufferImpl.cpp
+++ b/src/gpu/gl/GrGLBufferImpl.cpp
@@ -23,7 +23,7 @@
GrGLBufferImpl::GrGLBufferImpl(GrGLGpu* gpu, const Desc& desc, GrGLenum bufferType)
: fDesc(desc)
, fBufferType(bufferType)
- , fMapPtr(NULL) {
+ , fMapPtr(nullptr) {
if (0 == desc.fID) {
if (gpu->caps()->mustClearUploadedBufferData()) {
fCPUData = sk_calloc_throw(desc.fSizeInBytes);
@@ -32,7 +32,7 @@ GrGLBufferImpl::GrGLBufferImpl(GrGLGpu* gpu, const Desc& desc, GrGLenum bufferTy
}
fGLSizeInBytes = 0;
} else {
- fCPUData = NULL;
+ fCPUData = nullptr;
// We assume that the GL buffer was created at the desc's size initially.
fGLSizeInBytes = fDesc.fSizeInBytes;
}
@@ -44,7 +44,7 @@ void GrGLBufferImpl::release(GrGLGpu* gpu) {
// make sure we've not been abandoned or already released
if (fCPUData) {
sk_free(fCPUData);
- fCPUData = NULL;
+ fCPUData = nullptr;
} else if (fDesc.fID) {
GL_CALL(gpu, DeleteBuffers(1, &fDesc.fID));
if (GR_GL_ARRAY_BUFFER == fBufferType) {
@@ -56,16 +56,16 @@ void GrGLBufferImpl::release(GrGLGpu* gpu) {
fDesc.fID = 0;
fGLSizeInBytes = 0;
}
- fMapPtr = NULL;
+ fMapPtr = nullptr;
VALIDATE();
}
void GrGLBufferImpl::abandon() {
fDesc.fID = 0;
fGLSizeInBytes = 0;
- fMapPtr = NULL;
+ fMapPtr = nullptr;
sk_free(fCPUData);
- fCPUData = NULL;
+ fCPUData = nullptr;
VALIDATE();
}
@@ -89,14 +89,14 @@ void* GrGLBufferImpl::map(GrGLGpu* gpu) {
switch (gpu->glCaps().mapBufferType()) {
case GrGLCaps::kNone_MapBufferType:
VALIDATE();
- return NULL;
+ return nullptr;
case GrGLCaps::kMapBuffer_MapBufferType:
this->bind(gpu);
// Let driver know it can discard the old data
if (GR_GL_USE_BUFFER_DATA_NULL_HINT || fDesc.fSizeInBytes != fGLSizeInBytes) {
fGLSizeInBytes = fDesc.fSizeInBytes;
GL_CALL(gpu,
- BufferData(fBufferType, fGLSizeInBytes, NULL,
+ BufferData(fBufferType, fGLSizeInBytes, nullptr,
fDesc.fDynamic ? DYNAMIC_USAGE_PARAM : GR_GL_STATIC_DRAW));
}
GR_GL_CALL_RET(gpu->glInterface(), fMapPtr,
@@ -108,7 +108,7 @@ void* GrGLBufferImpl::map(GrGLGpu* gpu) {
if (fDesc.fSizeInBytes != fGLSizeInBytes) {
fGLSizeInBytes = fDesc.fSizeInBytes;
GL_CALL(gpu,
- BufferData(fBufferType, fGLSizeInBytes, NULL,
+ BufferData(fBufferType, fGLSizeInBytes, nullptr,
fDesc.fDynamic ? DYNAMIC_USAGE_PARAM : GR_GL_STATIC_DRAW));
}
static const GrGLbitfield kAccess = GR_GL_MAP_INVALIDATE_BUFFER_BIT |
@@ -124,7 +124,7 @@ void* GrGLBufferImpl::map(GrGLGpu* gpu) {
if (fDesc.fSizeInBytes != fGLSizeInBytes) {
fGLSizeInBytes = fDesc.fSizeInBytes;
GL_CALL(gpu,
- BufferData(fBufferType, fGLSizeInBytes, NULL,
+ BufferData(fBufferType, fGLSizeInBytes, nullptr,
fDesc.fDynamic ? DYNAMIC_USAGE_PARAM : GR_GL_STATIC_DRAW));
}
GR_GL_CALL_RET(gpu->glInterface(),
@@ -156,7 +156,7 @@ void GrGLBufferImpl::unmap(GrGLGpu* gpu) {
break;
}
}
- fMapPtr = NULL;
+ fMapPtr = nullptr;
}
bool GrGLBufferImpl::isMapped() const {
@@ -182,19 +182,19 @@ bool GrGLBufferImpl::updateData(GrGLGpu* gpu, const void* src, size_t srcSizeInB
GL_CALL(gpu, BufferData(fBufferType, (GrGLsizeiptr) srcSizeInBytes, src, usage));
} else {
// Before we call glBufferSubData we give the driver a hint using
- // glBufferData with NULL. This makes the old buffer contents
+ // glBufferData with nullptr. This makes the old buffer contents
// inaccessible to future draws. The GPU may still be processing
// draws that reference the old contents. With this hint it can
// assign a different allocation for the new contents to avoid
// flushing the gpu past draws consuming the old contents.
fGLSizeInBytes = fDesc.fSizeInBytes;
- GL_CALL(gpu, BufferData(fBufferType, fGLSizeInBytes, NULL, usage));
+ GL_CALL(gpu, BufferData(fBufferType, fGLSizeInBytes, nullptr, usage));
GL_CALL(gpu, BufferSubData(fBufferType, 0, (GrGLsizeiptr) srcSizeInBytes, src));
}
#else
// Note that we're cheating on the size here. Currently no methods
// allow a partial update that preserves contents of non-updated
- // portions of the buffer (map() does a glBufferData(..size, NULL..))
+ // portions of the buffer (map() does a glBufferData(..size, nullptr..))
bool doSubData = false;
#if GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND
static int N = 0;
@@ -209,7 +209,7 @@ bool GrGLBufferImpl::updateData(GrGLGpu* gpu, const void* src, size_t srcSizeInB
// exactly matches the buffer size into a glBufferData. So we tack 1
// extra byte onto the glBufferData.
fGLSizeInBytes = srcSizeInBytes + 1;
- GL_CALL(gpu, BufferData(fBufferType, fGLSizeInBytes, NULL, usage));
+ GL_CALL(gpu, BufferData(fBufferType, fGLSizeInBytes, nullptr, usage));
GL_CALL(gpu, BufferSubData(fBufferType, 0, srcSizeInBytes, src));
} else {
fGLSizeInBytes = srcSizeInBytes;
@@ -223,7 +223,7 @@ void GrGLBufferImpl::validate() const {
SkASSERT(GR_GL_ARRAY_BUFFER == fBufferType || GR_GL_ELEMENT_ARRAY_BUFFER == fBufferType);
// The following assert isn't valid when the buffer has been abandoned:
// SkASSERT((0 == fDesc.fID) == (fCPUData));
- SkASSERT(NULL == fCPUData || 0 == fGLSizeInBytes);
- SkASSERT(NULL == fMapPtr || fCPUData || fGLSizeInBytes == fDesc.fSizeInBytes);
- SkASSERT(NULL == fCPUData || NULL == fMapPtr || fCPUData == fMapPtr);
+ SkASSERT(nullptr == fCPUData || 0 == fGLSizeInBytes);
+ SkASSERT(nullptr == fMapPtr || fCPUData || fGLSizeInBytes == fDesc.fSizeInBytes);
+ SkASSERT(nullptr == fCPUData || nullptr == fMapPtr || fCPUData == fMapPtr);
}
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 19d6a8092d..ea2daeed1e 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -538,11 +538,11 @@ bool GrGLCaps::hasPathRenderingSupport(const GrGLContextInfo& ctxInfo, const GrG
// additions are detected by checking the existence of the function.
// We also use *Then* functions that not all drivers might have. Check
// them for consistency.
- if (NULL == gli->fFunctions.fStencilThenCoverFillPath ||
- NULL == gli->fFunctions.fStencilThenCoverStrokePath ||
- NULL == gli->fFunctions.fStencilThenCoverFillPathInstanced ||
- NULL == gli->fFunctions.fStencilThenCoverStrokePathInstanced ||
- NULL == gli->fFunctions.fProgramPathFragmentInputGen) {
+ if (nullptr == gli->fFunctions.fStencilThenCoverFillPath ||
+ nullptr == gli->fFunctions.fStencilThenCoverStrokePath ||
+ nullptr == gli->fFunctions.fStencilThenCoverFillPathInstanced ||
+ nullptr == gli->fFunctions.fStencilThenCoverStrokePathInstanced ||
+ nullptr == gli->fFunctions.fProgramPathFragmentInputGen) {
return false;
}
return true;
@@ -1192,7 +1192,7 @@ void GrGLCaps::initShaderPrecisionTable(const GrGLContextInfo& ctxInfo,
if (kGeometry_GrShaderType != s) {
GrShaderType shaderType = static_cast<GrShaderType>(s);
GrGLenum glShader = shader_type_to_gl_shader(shaderType);
- GrShaderCaps::PrecisionInfo* first = NULL;
+ GrShaderCaps::PrecisionInfo* first = nullptr;
glslCaps->fShaderPrecisionVaries = false;
for (int p = 0; p < kGrSLPrecisionCount; ++p) {
GrSLPrecision precision = static_cast<GrSLPrecision>(p);
diff --git a/src/gpu/gl/GrGLContext.cpp b/src/gpu/gl/GrGLContext.cpp
index b4fb3ea219..9e70b472c5 100644
--- a/src/gpu/gl/GrGLContext.cpp
+++ b/src/gpu/gl/GrGLContext.cpp
@@ -13,7 +13,7 @@
GrGLContext* GrGLContext::Create(const GrGLInterface* interface, const GrContextOptions& options) {
// We haven't validated the GrGLInterface yet, so check for GetString function pointer
if (!interface->fFunctions.fGetString) {
- return NULL;
+ return nullptr;
}
ConstructorArgs args;
args.fInterface = interface;
@@ -27,16 +27,16 @@ GrGLContext* GrGLContext::Create(const GrGLInterface* interface, const GrContext
const char* renderer = reinterpret_cast<const char*>(rendererUByte);
if (!interface->validate()) {
- return NULL;
+ return nullptr;
}
args.fGLVersion = GrGLGetVersionFromString(ver);
if (GR_GL_INVALID_VER == args.fGLVersion) {
- return NULL;
+ return nullptr;
}
if (!GrGLGetGLSLGeneration(interface, &args.fGLSLGeneration)) {
- return NULL;
+ return nullptr;
}
args.fVendor = GrGLGetVendor(interface);
diff --git a/src/gpu/gl/GrGLCreateNativeInterface_none.cpp b/src/gpu/gl/GrGLCreateNativeInterface_none.cpp
index e0c72c539d..0a0f279f16 100644
--- a/src/gpu/gl/GrGLCreateNativeInterface_none.cpp
+++ b/src/gpu/gl/GrGLCreateNativeInterface_none.cpp
@@ -8,5 +8,5 @@
#include "gl/GrGLInterface.h"
const GrGLInterface* GrGLCreateNativeInterface() {
- return NULL;
+ return nullptr;
}
diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp
index 37d0285009..1ed5f65e5c 100644
--- a/src/gpu/gl/GrGLCreateNullInterface.cpp
+++ b/src/gpu/gl/GrGLCreateNullInterface.cpp
@@ -22,7 +22,7 @@ class BufferObj {
public:
- BufferObj(GrGLuint id) : fID(id), fDataPtr(NULL), fSize(0), fMapped(false) {
+ BufferObj(GrGLuint id) : fID(id), fDataPtr(nullptr), fSize(0), fMapped(false) {
}
~BufferObj() { delete[] fDataPtr; }
@@ -58,11 +58,11 @@ public:
BufferManager() : fFreeListHead(kFreeListEnd) {}
~BufferManager() {
- // NULL out the entries that are really free list links rather than ptrs before deleting.
+ // nullptr out the entries that are really free list links rather than ptrs before deleting.
intptr_t curr = fFreeListHead;
while (kFreeListEnd != curr) {
intptr_t next = reinterpret_cast<intptr_t>(fBuffers[SkToS32(curr)]);
- fBuffers[SkToS32(curr)] = NULL;
+ fBuffers[SkToS32(curr)] = nullptr;
curr = next;
}
@@ -260,7 +260,7 @@ GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBufferRange(GrGLenum target, GrGLintptr o
buffer->setMapped(true);
return buffer->dataPtr();
}
- return NULL;
+ return nullptr;
}
GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBuffer(GrGLenum target, GrGLenum access) {
@@ -283,7 +283,7 @@ GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBuffer(GrGLenum target, GrGLenum access)
}
SkASSERT(false);
- return NULL; // no buffer bound to target
+ return nullptr; // no buffer bound to target
}
GrGLvoid GR_GL_FUNCTION_TYPE nullGLFlushMappedBufferRange(GrGLenum target,
diff --git a/src/gpu/gl/GrGLDefaultInterface_none.cpp b/src/gpu/gl/GrGLDefaultInterface_none.cpp
index 84c7f7c321..f9e52470bc 100644
--- a/src/gpu/gl/GrGLDefaultInterface_none.cpp
+++ b/src/gpu/gl/GrGLDefaultInterface_none.cpp
@@ -8,5 +8,5 @@
#include "gl/GrGLInterface.h"
const GrGLInterface* GrGLDefaultInterface() {
- return NULL;
+ return nullptr;
}
diff --git a/src/gpu/gl/GrGLExtensions.cpp b/src/gpu/gl/GrGLExtensions.cpp
index f2d54ff687..6d716d190f 100644
--- a/src/gpu/gl/GrGLExtensions.cpp
+++ b/src/gpu/gl/GrGLExtensions.cpp
@@ -48,7 +48,7 @@ bool GrGLExtensions::init(GrGLStandard standard,
fInitialized = false;
fStrings->reset();
- if (NULL == getString) {
+ if (nullptr == getString) {
return false;
}
@@ -62,7 +62,7 @@ bool GrGLExtensions::init(GrGLStandard standard,
bool indexed = version >= GR_GL_VER(3, 0);
if (indexed) {
- if (NULL == getStringi || NULL == getIntegerv) {
+ if (nullptr == getStringi || nullptr == getIntegerv) {
return false;
}
GrGLint extensionCnt = 0;
@@ -74,7 +74,7 @@ bool GrGLExtensions::init(GrGLStandard standard,
}
} else {
const char* extensions = (const char*) getString(GR_GL_EXTENSIONS);
- if (NULL == extensions) {
+ if (nullptr == extensions) {
return false;
}
while (true) {
@@ -133,7 +133,7 @@ void GrGLExtensions::add(const char ext[]) {
}
void GrGLExtensions::print(const char* sep) const {
- if (NULL == sep) {
+ if (nullptr == sep) {
sep = " ";
}
int cnt = fStrings->count();
diff --git a/src/gpu/gl/GrGLFragmentProcessor.h b/src/gpu/gl/GrGLFragmentProcessor.h
index 05ee375a9a..b8e2afc1bb 100644
--- a/src/gpu/gl/GrGLFragmentProcessor.h
+++ b/src/gpu/gl/GrGLFragmentProcessor.h
@@ -38,7 +38,7 @@ public:
@param outputColor A predefined vec4 in the FS in which the stage should place its output
color (or coverage).
@param inputColor A vec4 that holds the input color to the stage in the FS. This may be
- NULL in which case the implied input is solid white (all ones).
+ nullptr in which case the implied input is solid white (all ones).
TODO: Better system for communicating optimization info (e.g. input
color is solid white, trans black, known to be opaque, etc.) that allows
the processor to communicate back similar known info about its output.
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 92cfba1c7d..1a2896350e 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -169,13 +169,13 @@ GrGpu* GrGLGpu::Create(GrBackendContext backendContext, const GrContextOptions&
glInterface->ref();
}
if (!glInterface) {
- return NULL;
+ return nullptr;
}
GrGLContext* glContext = GrGLContext::Create(glInterface, options);
if (glContext) {
return new GrGLGpu(glContext, context);
}
- return NULL;
+ return nullptr;
}
static bool gPrintStartupSpew;
@@ -398,17 +398,17 @@ static GrSurfaceOrigin resolve_origin(GrSurfaceOrigin origin, bool renderTarget)
GrTexture* GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
GrWrapOwnership ownership) {
- if (!this->configToGLFormats(desc.fConfig, false, NULL, NULL, NULL)) {
- return NULL;
+ if (!this->configToGLFormats(desc.fConfig, false, nullptr, nullptr, nullptr)) {
+ return nullptr;
}
if (0 == desc.fTextureHandle) {
- return NULL;
+ return nullptr;
}
int maxSize = this->caps()->maxTextureSize();
if (desc.fWidth > maxSize || desc.fHeight > maxSize) {
- return NULL;
+ return nullptr;
}
GrGLTexture::IDDesc idDesc;
@@ -442,19 +442,19 @@ GrTexture* GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
surfDesc.fOrigin = desc.fOrigin;
}
- GrGLTexture* texture = NULL;
+ GrGLTexture* texture = nullptr;
if (renderTarget) {
GrGLRenderTarget::IDDesc rtIDDesc;
if (!this->createRenderTargetObjects(surfDesc, GrGpuResource::kUncached_LifeCycle,
idDesc.fTextureID, &rtIDDesc)) {
- return NULL;
+ return nullptr;
}
texture = new GrGLTextureRenderTarget(this, surfDesc, idDesc, rtIDDesc);
} else {
texture = new GrGLTexture(this, surfDesc, idDesc);
}
- if (NULL == texture) {
- return NULL;
+ if (nullptr == texture) {
+ return nullptr;
}
return texture;
@@ -564,7 +564,7 @@ bool GrGLGpu::onWritePixels(GrSurface* surface,
int left, int top, int width, int height,
GrPixelConfig config, const void* buffer,
size_t rowBytes) {
- if (NULL == buffer) {
+ if (nullptr == buffer) {
return false;
}
@@ -813,7 +813,7 @@ bool GrGLGpu::uploadCompressedTexData(const GrSurfaceDesc& desc,
// We only need the internal format for compressed 2D textures.
GrGLenum internalFormat = 0;
- if (!this->configToGLFormats(desc.fConfig, false, &internalFormat, NULL, NULL)) {
+ if (!this->configToGLFormats(desc.fConfig, false, &internalFormat, nullptr, nullptr)) {
return false;
}
@@ -926,8 +926,8 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc,
// ES2 and ES3 require sized internal formats for rb storage.
kGLES_GrGLStandard == this->glStandard(),
&msColorFormat,
- NULL,
- NULL)) {
+ nullptr,
+ nullptr)) {
goto FAILED;
}
} else {
@@ -1001,7 +1001,7 @@ FAILED:
// good to set a break-point here to know when createTexture fails
static GrTexture* return_null_texture() {
// SkDEBUGFAIL("null texture");
- return NULL;
+ return nullptr;
}
#if 0 && defined(SK_DEBUG)
@@ -1294,7 +1294,7 @@ bool GrGLGpu::attachStencilAttachmentToRenderTarget(GrStencilAttachment* sb, GrR
GrGLuint fbo = glrt->renderFBOID();
- if (NULL == sb) {
+ if (nullptr == sb) {
if (rt->renderTargetPriv().getStencilAttachment()) {
GL_CALL(FramebufferRenderbuffer(GR_GL_FRAMEBUFFER,
GR_GL_STENCIL_ATTACHMENT,
@@ -1372,17 +1372,17 @@ GrVertexBuffer* GrGLGpu::onCreateVertexBuffer(size_t size, bool dynamic) {
GL_ALLOC_CALL(this->glInterface(),
BufferData(GR_GL_ARRAY_BUFFER,
(GrGLsizeiptr) desc.fSizeInBytes,
- NULL, // data ptr
+ nullptr, // data ptr
desc.fDynamic ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW));
if (CHECK_ALLOC_ERROR(this->glInterface()) != GR_GL_NO_ERROR) {
GL_CALL(DeleteBuffers(1, &desc.fID));
this->notifyVertexBufferDelete(desc.fID);
- return NULL;
+ return nullptr;
}
GrGLVertexBuffer* vertexBuffer = new GrGLVertexBuffer(this, desc);
return vertexBuffer;
}
- return NULL;
+ return nullptr;
}
}
@@ -1404,17 +1404,17 @@ GrIndexBuffer* GrGLGpu::onCreateIndexBuffer(size_t size, bool dynamic) {
GL_ALLOC_CALL(this->glInterface(),
BufferData(GR_GL_ELEMENT_ARRAY_BUFFER,
(GrGLsizeiptr) desc.fSizeInBytes,
- NULL, // data ptr
+ nullptr, // data ptr
desc.fDynamic ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW));
if (CHECK_ALLOC_ERROR(this->glInterface()) != GR_GL_NO_ERROR) {
GL_CALL(DeleteBuffers(1, &desc.fID));
this->notifyIndexBufferDelete(desc.fID);
- return NULL;
+ return nullptr;
}
GrIndexBuffer* indexBuffer = new GrGLIndexBuffer(this, desc);
return indexBuffer;
}
- return NULL;
+ return nullptr;
}
}
@@ -1489,7 +1489,7 @@ bool GrGLGpu::flushGLState(const DrawArgs& args) {
// This must come after textures are flushed because a texture may need
// to be msaa-resolved (which will modify bound FBO state).
- this->flushRenderTarget(glRT, NULL);
+ this->flushRenderTarget(glRT, nullptr);
return true;
}
@@ -1503,7 +1503,7 @@ void GrGLGpu::setupGeometry(const GrPrimitiveProcessor& primProc,
SkASSERT(vbuf);
SkASSERT(!vbuf->isMapped());
- GrGLIndexBuffer* ibuf = NULL;
+ GrGLIndexBuffer* ibuf = nullptr;
if (vertices.isIndexed()) {
SkASSERT(indexOffsetInBytes);
@@ -1638,7 +1638,7 @@ void GrGLGpu::discard(GrRenderTarget* renderTarget) {
}
void GrGLGpu::clearStencil(GrRenderTarget* target) {
- if (NULL == target) {
+ if (nullptr == target) {
return;
}
GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(target);
@@ -1799,7 +1799,7 @@ bool GrGLGpu::onReadPixels(GrSurface* surface,
GrGLenum format = 0;
GrGLenum type = 0;
bool flipY = kBottomLeft_GrSurfaceOrigin == surface->origin();
- if (!this->configToGLFormats(config, false, NULL, &format, &type)) {
+ if (!this->configToGLFormats(config, false, nullptr, &format, &type)) {
return false;
}
@@ -1947,7 +1947,7 @@ void GrGLGpu::flushRenderTarget(GrGLRenderTarget* target, const SkIRect* bound)
}
}
}
- if (NULL == bound || !bound->isEmpty()) {
+ if (nullptr == bound || !bound->isEmpty()) {
target->flagAsNeedingResolve(bound);
}
@@ -2409,13 +2409,13 @@ bool GrGLGpu::configToGLFormats(GrPixelConfig config,
GrGLenum* externalFormat,
GrGLenum* externalType) const {
GrGLenum dontCare;
- if (NULL == internalFormat) {
+ if (nullptr == internalFormat) {
internalFormat = &dontCare;
}
- if (NULL == externalFormat) {
+ if (nullptr == externalFormat) {
externalFormat = &dontCare;
}
- if (NULL == externalType) {
+ if (nullptr == externalType) {
externalType = &dontCare;
}
@@ -2670,7 +2670,7 @@ inline bool can_copy_texsubimage(const GrSurface* dst,
GrGLuint GrGLGpu::bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLIRect* viewport,
TempFBOTarget tempFBOTarget) {
GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(surface->asRenderTarget());
- if (NULL == rt) {
+ if (nullptr == rt) {
SkASSERT(surface->asTexture());
GrGLuint texID = static_cast<GrGLTexture*>(surface->asTexture())->textureID();
GrGLuint* tempFBOID;
@@ -2736,7 +2736,7 @@ bool GrGLGpu::initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc)
return true;
}
return false;
- } else if (NULL == src->asRenderTarget()) {
+ } else if (nullptr == src->asRenderTarget()) {
// CopyTexSubImage2D or fbo blit would require creating a temp fbo for the src.
return false;
}
@@ -3147,7 +3147,7 @@ GrGLAttribArrayState* GrGLGpu::HWGeometryState::bindArrayAndBuffersToDraw(
const GrGLIndexBuffer* ibuffer) {
SkASSERT(vbuffer);
GrGLuint vbufferID = vbuffer->bufferID();
- GrGLuint* ibufferIDPtr = NULL;
+ GrGLuint* ibufferIDPtr = nullptr;
GrGLuint ibufferID;
if (ibuffer) {
ibufferID = ibuffer->bufferID();
@@ -3158,7 +3158,7 @@ GrGLAttribArrayState* GrGLGpu::HWGeometryState::bindArrayAndBuffersToDraw(
GrGLAttribArrayState* GrGLGpu::HWGeometryState::bindArrayAndBufferToDraw(GrGLGpu* gpu,
GrGLuint vbufferID) {
- return this->internalBind(gpu, vbufferID, NULL);
+ return this->internalBind(gpu, vbufferID, nullptr);
}
GrGLAttribArrayState* GrGLGpu::HWGeometryState::bindArrayAndBuffersToDraw(GrGLGpu* gpu,
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 4be8a76fba..f6d6a471e9 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -254,7 +254,7 @@ private:
void setScratchTextureUnit();
// bounds is region that may be modified and therefore has to be resolved.
- // NULL means whole target. Can be an empty rect.
+ // nullptr means whole target. Can be an empty rect.
void flushRenderTarget(GrGLRenderTarget*, const SkIRect* bounds);
void flushStencil(const GrStencilSettings&);
@@ -339,7 +339,7 @@ private:
*/
class HWGeometryState {
public:
- HWGeometryState() { fVBOVertexArray = NULL; this->invalidate(); }
+ HWGeometryState() { fVBOVertexArray = nullptr; this->invalidate(); }
~HWGeometryState() { delete fVBOVertexArray; }
@@ -418,7 +418,7 @@ private:
/**
* Binds the vertex array object that should be used to render from the vertex buffer.
* The vertex array is bound and its attrib array state object is returned. The vertex
- * buffer is bound. The index buffer (if non-NULL) is bound to the vertex array. The
+ * buffer is bound. The index buffer (if non-nullptr) is bound to the vertex array. The
* returned GrGLAttribArrayState should be used to set vertex attribute arrays.
*/
GrGLAttribArrayState* bindArrayAndBuffersToDraw(GrGLGpu* gpu,
diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp
index c6b673b95b..d74b54aeba 100644
--- a/src/gpu/gl/GrGLGpuProgramCache.cpp
+++ b/src/gpu/gl/GrGLGpuProgramCache.cpp
@@ -23,7 +23,7 @@ typedef GrGLProgramDataManager::UniformHandle UniformHandle;
struct GrGLGpu::ProgramCache::Entry {
- Entry() : fProgram(NULL), fLRUStamp(0) {}
+ Entry() : fProgram(nullptr), fLRUStamp(0) {}
SkAutoTUnref<GrGLProgram> fProgram;
unsigned int fLRUStamp;
@@ -52,7 +52,7 @@ GrGLGpu::ProgramCache::ProgramCache(GrGLGpu* gpu)
#endif
{
for (int i = 0; i < 1 << kHashBits; ++i) {
- fHashTable[i] = NULL;
+ fHashTable[i] = nullptr;
}
}
@@ -95,7 +95,7 @@ GrGLProgram* GrGLGpu::ProgramCache::refProgram(const DrawArgs& args) {
++fTotalRequests;
#endif
- Entry* entry = NULL;
+ Entry* entry = nullptr;
uint32_t hashIdx = args.fDesc->getChecksum();
hashIdx ^= hashIdx >> 16;
@@ -110,7 +110,7 @@ GrGLProgram* GrGLGpu::ProgramCache::refProgram(const DrawArgs& args) {
}
int entryIdx;
- if (NULL == entry) {
+ if (nullptr == entry) {
entryIdx = this->search(*args.fDesc);
if (entryIdx >= 0) {
entry = fEntries[entryIdx];
@@ -120,14 +120,14 @@ GrGLProgram* GrGLGpu::ProgramCache::refProgram(const DrawArgs& args) {
}
}
- if (NULL == entry) {
+ if (nullptr == entry) {
// We have a cache miss
#ifdef PROGRAM_CACHE_STATS
++fCacheMisses;
#endif
GrGLProgram* program = GrGLProgramBuilder::CreateProgram(args, fGpu);
- if (NULL == program) {
- return NULL;
+ if (nullptr == program) {
+ return nullptr;
}
int purgeIdx = 0;
if (fCount < kMaxEntries) {
@@ -145,7 +145,7 @@ GrGLProgram* GrGLGpu::ProgramCache::refProgram(const DrawArgs& args) {
entry = fEntries[purgeIdx];
int purgedHashIdx = entry->fProgram->getDesc().getChecksum() & ((1 << kHashBits) - 1);
if (fHashTable[purgedHashIdx] == entry) {
- fHashTable[purgedHashIdx] = NULL;
+ fHashTable[purgedHashIdx] = nullptr;
}
}
SkASSERT(fEntries[purgeIdx] == entry);
diff --git a/src/gpu/gl/GrGLIndexBuffer.cpp b/src/gpu/gl/GrGLIndexBuffer.cpp
index 52cf5f87f7..d60d391085 100644
--- a/src/gpu/gl/GrGLIndexBuffer.cpp
+++ b/src/gpu/gl/GrGLIndexBuffer.cpp
@@ -31,7 +31,7 @@ void* GrGLIndexBuffer::onMap() {
if (!this->wasDestroyed()) {
return fImpl.map(this->getGpuGL());
} else {
- return NULL;
+ return nullptr;
}
}
diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp
index fca7bf2d2f..ec51797c7e 100644
--- a/src/gpu/gl/GrGLInterface.cpp
+++ b/src/gpu/gl/GrGLInterface.cpp
@@ -39,27 +39,27 @@ const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) {
GrGLInterface* newInterface = GrGLInterface::NewClone(interface);
newInterface->fExtensions.remove("GL_NV_path_rendering");
- newInterface->fFunctions.fPathCommands = NULL;
- newInterface->fFunctions.fPathParameteri = NULL;
- newInterface->fFunctions.fPathParameterf = NULL;
- newInterface->fFunctions.fGenPaths = NULL;
- newInterface->fFunctions.fDeletePaths = NULL;
- newInterface->fFunctions.fIsPath = NULL;
- newInterface->fFunctions.fPathStencilFunc = NULL;
- newInterface->fFunctions.fStencilFillPath = NULL;
- newInterface->fFunctions.fStencilStrokePath = NULL;
- newInterface->fFunctions.fStencilFillPathInstanced = NULL;
- newInterface->fFunctions.fStencilStrokePathInstanced = NULL;
- newInterface->fFunctions.fCoverFillPath = NULL;
- newInterface->fFunctions.fCoverStrokePath = NULL;
- newInterface->fFunctions.fCoverFillPathInstanced = NULL;
- newInterface->fFunctions.fCoverStrokePathInstanced = NULL;
- newInterface->fFunctions.fStencilThenCoverFillPath = NULL;
- newInterface->fFunctions.fStencilThenCoverStrokePath = NULL;
- newInterface->fFunctions.fStencilThenCoverFillPathInstanced = NULL;
- newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = NULL;
- newInterface->fFunctions.fProgramPathFragmentInputGen = NULL;
- newInterface->fFunctions.fBindFragmentInputLocation = NULL;
+ newInterface->fFunctions.fPathCommands = nullptr;
+ newInterface->fFunctions.fPathParameteri = nullptr;
+ newInterface->fFunctions.fPathParameterf = nullptr;
+ newInterface->fFunctions.fGenPaths = nullptr;
+ newInterface->fFunctions.fDeletePaths = nullptr;
+ newInterface->fFunctions.fIsPath = nullptr;
+ newInterface->fFunctions.fPathStencilFunc = nullptr;
+ newInterface->fFunctions.fStencilFillPath = nullptr;
+ newInterface->fFunctions.fStencilStrokePath = nullptr;
+ newInterface->fFunctions.fStencilFillPathInstanced = nullptr;
+ newInterface->fFunctions.fStencilStrokePathInstanced = nullptr;
+ newInterface->fFunctions.fCoverFillPath = nullptr;
+ newInterface->fFunctions.fCoverStrokePath = nullptr;
+ newInterface->fFunctions.fCoverFillPathInstanced = nullptr;
+ newInterface->fFunctions.fCoverStrokePathInstanced = nullptr;
+ newInterface->fFunctions.fStencilThenCoverFillPath = nullptr;
+ newInterface->fFunctions.fStencilThenCoverStrokePath = nullptr;
+ newInterface->fFunctions.fStencilThenCoverFillPathInstanced = nullptr;
+ newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = nullptr;
+ newInterface->fFunctions.fProgramPathFragmentInputGen = nullptr;
+ newInterface->fFunctions.fBindFragmentInputLocation = nullptr;
return newInterface;
}
@@ -107,105 +107,105 @@ bool GrGLInterface::validate() const {
}
// functions that are always required
- if (NULL == fFunctions.fActiveTexture ||
- NULL == fFunctions.fAttachShader ||
- NULL == fFunctions.fBindAttribLocation ||
- NULL == fFunctions.fBindBuffer ||
- NULL == fFunctions.fBindTexture ||
- NULL == fFunctions.fBlendColor || // -> GL >= 1.4 or extension, ES >= 2.0
- NULL == fFunctions.fBlendEquation || // -> GL >= 1.4 or extension, ES >= 2.0
- NULL == fFunctions.fBlendFunc ||
- NULL == fFunctions.fBufferData ||
- NULL == fFunctions.fBufferSubData ||
- NULL == fFunctions.fClear ||
- NULL == fFunctions.fClearColor ||
- NULL == fFunctions.fClearStencil ||
- NULL == fFunctions.fColorMask ||
- NULL == fFunctions.fCompileShader ||
- NULL == fFunctions.fCopyTexSubImage2D ||
- NULL == fFunctions.fCreateProgram ||
- NULL == fFunctions.fCreateShader ||
- NULL == fFunctions.fCullFace ||
- NULL == fFunctions.fDeleteBuffers ||
- NULL == fFunctions.fDeleteProgram ||
- NULL == fFunctions.fDeleteShader ||
- NULL == fFunctions.fDeleteTextures ||
- NULL == fFunctions.fDepthMask ||
- NULL == fFunctions.fDisable ||
- NULL == fFunctions.fDisableVertexAttribArray ||
- NULL == fFunctions.fDrawArrays ||
- NULL == fFunctions.fDrawElements ||
- NULL == fFunctions.fEnable ||
- NULL == fFunctions.fEnableVertexAttribArray ||
- NULL == fFunctions.fFrontFace ||
- NULL == fFunctions.fGenBuffers ||
- NULL == fFunctions.fGenTextures ||
- NULL == fFunctions.fGetBufferParameteriv ||
- NULL == fFunctions.fGenerateMipmap ||
- NULL == fFunctions.fGetError ||
- NULL == fFunctions.fGetIntegerv ||
- NULL == fFunctions.fGetProgramInfoLog ||
- NULL == fFunctions.fGetProgramiv ||
- NULL == fFunctions.fGetShaderInfoLog ||
- NULL == fFunctions.fGetShaderiv ||
- NULL == fFunctions.fGetString ||
- NULL == fFunctions.fGetUniformLocation ||
+ if (nullptr == fFunctions.fActiveTexture ||
+ nullptr == fFunctions.fAttachShader ||
+ nullptr == fFunctions.fBindAttribLocation ||
+ nullptr == fFunctions.fBindBuffer ||
+ nullptr == fFunctions.fBindTexture ||
+ nullptr == fFunctions.fBlendColor || // -> GL >= 1.4 or extension, ES >= 2.0
+ nullptr == fFunctions.fBlendEquation || // -> GL >= 1.4 or extension, ES >= 2.0
+ nullptr == fFunctions.fBlendFunc ||
+ nullptr == fFunctions.fBufferData ||
+ nullptr == fFunctions.fBufferSubData ||
+ nullptr == fFunctions.fClear ||
+ nullptr == fFunctions.fClearColor ||
+ nullptr == fFunctions.fClearStencil ||
+ nullptr == fFunctions.fColorMask ||
+ nullptr == fFunctions.fCompileShader ||
+ nullptr == fFunctions.fCopyTexSubImage2D ||
+ nullptr == fFunctions.fCreateProgram ||
+ nullptr == fFunctions.fCreateShader ||
+ nullptr == fFunctions.fCullFace ||
+ nullptr == fFunctions.fDeleteBuffers ||
+ nullptr == fFunctions.fDeleteProgram ||
+ nullptr == fFunctions.fDeleteShader ||
+ nullptr == fFunctions.fDeleteTextures ||
+ nullptr == fFunctions.fDepthMask ||
+ nullptr == fFunctions.fDisable ||
+ nullptr == fFunctions.fDisableVertexAttribArray ||
+ nullptr == fFunctions.fDrawArrays ||
+ nullptr == fFunctions.fDrawElements ||
+ nullptr == fFunctions.fEnable ||
+ nullptr == fFunctions.fEnableVertexAttribArray ||
+ nullptr == fFunctions.fFrontFace ||
+ nullptr == fFunctions.fGenBuffers ||
+ nullptr == fFunctions.fGenTextures ||
+ nullptr == fFunctions.fGetBufferParameteriv ||
+ nullptr == fFunctions.fGenerateMipmap ||
+ nullptr == fFunctions.fGetError ||
+ nullptr == fFunctions.fGetIntegerv ||
+ nullptr == fFunctions.fGetProgramInfoLog ||
+ nullptr == fFunctions.fGetProgramiv ||
+ nullptr == fFunctions.fGetShaderInfoLog ||
+ nullptr == fFunctions.fGetShaderiv ||
+ nullptr == fFunctions.fGetString ||
+ nullptr == fFunctions.fGetUniformLocation ||
#if 0 // Not included in Chrome yet
- NULL == fFunctions.fIsTexture ||
+ nullptr == fFunctions.fIsTexture ||
#endif
- NULL == fFunctions.fLinkProgram ||
- NULL == fFunctions.fLineWidth ||
- NULL == fFunctions.fPixelStorei ||
- NULL == fFunctions.fReadPixels ||
- NULL == fFunctions.fScissor ||
- NULL == fFunctions.fShaderSource ||
- NULL == fFunctions.fStencilFunc ||
- NULL == fFunctions.fStencilMask ||
- NULL == fFunctions.fStencilOp ||
- NULL == fFunctions.fTexImage2D ||
- NULL == fFunctions.fTexParameteri ||
- NULL == fFunctions.fTexParameteriv ||
- NULL == fFunctions.fTexSubImage2D ||
- NULL == fFunctions.fUniform1f ||
- NULL == fFunctions.fUniform1i ||
- NULL == fFunctions.fUniform1fv ||
- NULL == fFunctions.fUniform1iv ||
- NULL == fFunctions.fUniform2f ||
- NULL == fFunctions.fUniform2i ||
- NULL == fFunctions.fUniform2fv ||
- NULL == fFunctions.fUniform2iv ||
- NULL == fFunctions.fUniform3f ||
- NULL == fFunctions.fUniform3i ||
- NULL == fFunctions.fUniform3fv ||
- NULL == fFunctions.fUniform3iv ||
- NULL == fFunctions.fUniform4f ||
- NULL == fFunctions.fUniform4i ||
- NULL == fFunctions.fUniform4fv ||
- NULL == fFunctions.fUniform4iv ||
- NULL == fFunctions.fUniformMatrix2fv ||
- NULL == fFunctions.fUniformMatrix3fv ||
- NULL == fFunctions.fUniformMatrix4fv ||
- NULL == fFunctions.fUseProgram ||
- NULL == fFunctions.fVertexAttrib1f ||
- NULL == fFunctions.fVertexAttrib2fv ||
- NULL == fFunctions.fVertexAttrib3fv ||
- NULL == fFunctions.fVertexAttrib4fv ||
- NULL == fFunctions.fVertexAttribPointer ||
- NULL == fFunctions.fViewport ||
- NULL == fFunctions.fBindFramebuffer ||
- NULL == fFunctions.fBindRenderbuffer ||
- NULL == fFunctions.fCheckFramebufferStatus ||
- NULL == fFunctions.fDeleteFramebuffers ||
- NULL == fFunctions.fDeleteRenderbuffers ||
- NULL == fFunctions.fFinish ||
- NULL == fFunctions.fFlush ||
- NULL == fFunctions.fFramebufferRenderbuffer ||
- NULL == fFunctions.fFramebufferTexture2D ||
- NULL == fFunctions.fGetFramebufferAttachmentParameteriv ||
- NULL == fFunctions.fGetRenderbufferParameteriv ||
- NULL == fFunctions.fGenFramebuffers ||
- NULL == fFunctions.fGenRenderbuffers ||
- NULL == fFunctions.fRenderbufferStorage) {
+ nullptr == fFunctions.fLinkProgram ||
+ nullptr == fFunctions.fLineWidth ||
+ nullptr == fFunctions.fPixelStorei ||
+ nullptr == fFunctions.fReadPixels ||
+ nullptr == fFunctions.fScissor ||
+ nullptr == fFunctions.fShaderSource ||
+ nullptr == fFunctions.fStencilFunc ||
+ nullptr == fFunctions.fStencilMask ||
+ nullptr == fFunctions.fStencilOp ||
+ nullptr == fFunctions.fTexImage2D ||
+ nullptr == fFunctions.fTexParameteri ||
+ nullptr == fFunctions.fTexParameteriv ||
+ nullptr == fFunctions.fTexSubImage2D ||
+ nullptr == fFunctions.fUniform1f ||
+ nullptr == fFunctions.fUniform1i ||
+ nullptr == fFunctions.fUniform1fv ||
+ nullptr == fFunctions.fUniform1iv ||
+ nullptr == fFunctions.fUniform2f ||
+ nullptr == fFunctions.fUniform2i ||
+ nullptr == fFunctions.fUniform2fv ||
+ nullptr == fFunctions.fUniform2iv ||
+ nullptr == fFunctions.fUniform3f ||
+ nullptr == fFunctions.fUniform3i ||
+ nullptr == fFunctions.fUniform3fv ||
+ nullptr == fFunctions.fUniform3iv ||
+ nullptr == fFunctions.fUniform4f ||
+ nullptr == fFunctions.fUniform4i ||
+ nullptr == fFunctions.fUniform4fv ||
+ nullptr == fFunctions.fUniform4iv ||
+ nullptr == fFunctions.fUniformMatrix2fv ||
+ nullptr == fFunctions.fUniformMatrix3fv ||
+ nullptr == fFunctions.fUniformMatrix4fv ||
+ nullptr == fFunctions.fUseProgram ||
+ nullptr == fFunctions.fVertexAttrib1f ||
+ nullptr == fFunctions.fVertexAttrib2fv ||
+ nullptr == fFunctions.fVertexAttrib3fv ||
+ nullptr == fFunctions.fVertexAttrib4fv ||
+ nullptr == fFunctions.fVertexAttribPointer ||
+ nullptr == fFunctions.fViewport ||
+ nullptr == fFunctions.fBindFramebuffer ||
+ nullptr == fFunctions.fBindRenderbuffer ||
+ nullptr == fFunctions.fCheckFramebufferStatus ||
+ nullptr == fFunctions.fDeleteFramebuffers ||
+ nullptr == fFunctions.fDeleteRenderbuffers ||
+ nullptr == fFunctions.fFinish ||
+ nullptr == fFunctions.fFlush ||
+ nullptr == fFunctions.fFramebufferRenderbuffer ||
+ nullptr == fFunctions.fFramebufferTexture2D ||
+ nullptr == fFunctions.fGetFramebufferAttachmentParameteriv ||
+ nullptr == fFunctions.fGetRenderbufferParameteriv ||
+ nullptr == fFunctions.fGenFramebuffers ||
+ nullptr == fFunctions.fGenRenderbuffers ||
+ nullptr == fFunctions.fRenderbufferStorage) {
RETURN_FALSE_INTERFACE
}
@@ -222,50 +222,50 @@ bool GrGLInterface::validate() const {
// On the desktop we assume they are available if the extension
// is present or GL version is high enough.
if (kGLES_GrGLStandard == fStandard) {
- if (NULL == fFunctions.fStencilFuncSeparate ||
- NULL == fFunctions.fStencilMaskSeparate ||
- NULL == fFunctions.fStencilOpSeparate) {
+ if (nullptr == fFunctions.fStencilFuncSeparate ||
+ nullptr == fFunctions.fStencilMaskSeparate ||
+ nullptr == fFunctions.fStencilOpSeparate) {
RETURN_FALSE_INTERFACE
}
} else if (kGL_GrGLStandard == fStandard) {
if (glVer >= GR_GL_VER(2,0)) {
- if (NULL == fFunctions.fStencilFuncSeparate ||
- NULL == fFunctions.fStencilMaskSeparate ||
- NULL == fFunctions.fStencilOpSeparate) {
+ if (nullptr == fFunctions.fStencilFuncSeparate ||
+ nullptr == fFunctions.fStencilMaskSeparate ||
+ nullptr == fFunctions.fStencilOpSeparate) {
RETURN_FALSE_INTERFACE
}
}
- if (glVer >= GR_GL_VER(3,0) && NULL == fFunctions.fBindFragDataLocation) {
+ if (glVer >= GR_GL_VER(3,0) && nullptr == fFunctions.fBindFragDataLocation) {
RETURN_FALSE_INTERFACE
}
if (glVer >= GR_GL_VER(2,0) || fExtensions.has("GL_ARB_draw_buffers")) {
- if (NULL == fFunctions.fDrawBuffers) {
+ if (nullptr == fFunctions.fDrawBuffers) {
RETURN_FALSE_INTERFACE
}
}
if (glVer >= GR_GL_VER(1,5) || fExtensions.has("GL_ARB_occlusion_query")) {
- if (NULL == fFunctions.fGenQueries ||
- NULL == fFunctions.fDeleteQueries ||
- NULL == fFunctions.fBeginQuery ||
- NULL == fFunctions.fEndQuery ||
- NULL == fFunctions.fGetQueryiv ||
- NULL == fFunctions.fGetQueryObjectiv ||
- NULL == fFunctions.fGetQueryObjectuiv) {
+ if (nullptr == fFunctions.fGenQueries ||
+ nullptr == fFunctions.fDeleteQueries ||
+ nullptr == fFunctions.fBeginQuery ||
+ nullptr == fFunctions.fEndQuery ||
+ nullptr == fFunctions.fGetQueryiv ||
+ nullptr == fFunctions.fGetQueryObjectiv ||
+ nullptr == fFunctions.fGetQueryObjectuiv) {
RETURN_FALSE_INTERFACE
}
}
if (glVer >= GR_GL_VER(3,3) ||
fExtensions.has("GL_ARB_timer_query") ||
fExtensions.has("GL_EXT_timer_query")) {
- if (NULL == fFunctions.fGetQueryObjecti64v ||
- NULL == fFunctions.fGetQueryObjectui64v) {
+ if (nullptr == fFunctions.fGetQueryObjecti64v ||
+ nullptr == fFunctions.fGetQueryObjectui64v) {
RETURN_FALSE_INTERFACE
}
}
if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_timer_query")) {
- if (NULL == fFunctions.fQueryCounter) {
+ if (nullptr == fFunctions.fQueryCounter) {
RETURN_FALSE_INTERFACE
}
}
@@ -275,9 +275,9 @@ bool GrGLInterface::validate() const {
if (kGL_GrGLStandard != fStandard ||
(glVer >= GR_GL_VER(1,3)) ||
fExtensions.has("GL_ARB_texture_compression")) {
- if (NULL == fFunctions.fCompressedTexImage2D
+ if (nullptr == fFunctions.fCompressedTexImage2D
#if 0
- || NULL == fFunctions.fCompressedTexSubImage2D
+ || nullptr == fFunctions.fCompressedTexSubImage2D
#endif
) {
RETURN_FALSE_INTERFACE
@@ -286,9 +286,9 @@ bool GrGLInterface::validate() const {
// part of desktop GL, but not ES
if (kGL_GrGLStandard == fStandard &&
- (NULL == fFunctions.fGetTexLevelParameteriv ||
- NULL == fFunctions.fDrawBuffer ||
- NULL == fFunctions.fReadBuffer)) {
+ (nullptr == fFunctions.fGetTexLevelParameteriv ||
+ nullptr == fFunctions.fDrawBuffer ||
+ nullptr == fFunctions.fReadBuffer)) {
RETURN_FALSE_INTERFACE
}
@@ -298,12 +298,12 @@ bool GrGLInterface::validate() const {
if (glVer >= GR_GL_VER(4,2) ||
fExtensions.has("GL_ARB_texture_storage") ||
fExtensions.has("GL_EXT_texture_storage")) {
- if (NULL == fFunctions.fTexStorage2D) {
+ if (nullptr == fFunctions.fTexStorage2D) {
RETURN_FALSE_INTERFACE
}
}
} else if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_texture_storage")) {
- if (NULL == fFunctions.fTexStorage2D) {
+ if (nullptr == fFunctions.fTexStorage2D) {
RETURN_FALSE_INTERFACE
}
}
@@ -313,19 +313,19 @@ bool GrGLInterface::validate() const {
if (glVer >= GR_GL_VER(4,5) ||
fExtensions.has("GL_ARB_texture_barrier") ||
fExtensions.has("GL_NV_texture_barrier")) {
- if (NULL == fFunctions.fTextureBarrier) {
+ if (nullptr == fFunctions.fTextureBarrier) {
RETURN_FALSE_INTERFACE
}
}
} else if (fExtensions.has("GL_NV_texture_barrier")) {
- if (NULL == fFunctions.fTextureBarrier) {
+ if (nullptr == fFunctions.fTextureBarrier) {
RETURN_FALSE_INTERFACE
}
}
if (fExtensions.has("GL_KHR_blend_equation_advanced") ||
fExtensions.has("GL_NV_blend_equation_advanced")) {
- if (NULL == fFunctions.fBlendBarrier) {
+ if (nullptr == fFunctions.fBlendBarrier) {
RETURN_FALSE_INTERFACE
}
}
@@ -333,7 +333,7 @@ bool GrGLInterface::validate() const {
if (fExtensions.has("GL_EXT_discard_framebuffer")) {
// FIXME: Remove this once Chromium is updated to provide this function
#if 0
- if (NULL == fFunctions.fDiscardFramebuffer) {
+ if (nullptr == fFunctions.fDiscardFramebuffer) {
RETURN_FALSE_INTERFACE
}
#endif
@@ -343,37 +343,37 @@ bool GrGLInterface::validate() const {
if (kGL_GrGLStandard == fStandard) {
// GL 3.0 and the ARB extension have multisample + blit
if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_ARB_framebuffer_object")) {
- if (NULL == fFunctions.fRenderbufferStorageMultisample ||
- NULL == fFunctions.fBlitFramebuffer) {
+ if (nullptr == fFunctions.fRenderbufferStorageMultisample ||
+ nullptr == fFunctions.fBlitFramebuffer) {
RETURN_FALSE_INTERFACE
}
} else {
if (fExtensions.has("GL_EXT_framebuffer_blit") &&
- NULL == fFunctions.fBlitFramebuffer) {
+ nullptr == fFunctions.fBlitFramebuffer) {
RETURN_FALSE_INTERFACE
}
if (fExtensions.has("GL_EXT_framebuffer_multisample") &&
- NULL == fFunctions.fRenderbufferStorageMultisample) {
+ nullptr == fFunctions.fRenderbufferStorageMultisample) {
RETURN_FALSE_INTERFACE
}
}
} else {
if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_CHROMIUM_framebuffer_multisample")) {
- if (NULL == fFunctions.fRenderbufferStorageMultisample ||
- NULL == fFunctions.fBlitFramebuffer) {
+ if (nullptr == fFunctions.fRenderbufferStorageMultisample ||
+ nullptr == fFunctions.fBlitFramebuffer) {
RETURN_FALSE_INTERFACE
}
}
if (fExtensions.has("GL_APPLE_framebuffer_multisample")) {
- if (NULL == fFunctions.fRenderbufferStorageMultisampleES2APPLE ||
- NULL == fFunctions.fResolveMultisampleFramebuffer) {
+ if (nullptr == fFunctions.fRenderbufferStorageMultisampleES2APPLE ||
+ nullptr == fFunctions.fResolveMultisampleFramebuffer) {
RETURN_FALSE_INTERFACE
}
}
if (fExtensions.has("GL_IMG_multisampled_render_to_texture") ||
fExtensions.has("GL_EXT_multisampled_render_to_texture")) {
- if (NULL == fFunctions.fRenderbufferStorageMultisampleES2EXT ||
- NULL == fFunctions.fFramebufferTexture2DMultisample) {
+ if (nullptr == fFunctions.fRenderbufferStorageMultisampleES2EXT ||
+ nullptr == fFunctions.fFramebufferTexture2DMultisample) {
RETURN_FALSE_INTERFACE
}
}
@@ -383,8 +383,8 @@ bool GrGLInterface::validate() const {
// buffer mapping was part of original VBO extension
// which we require.
if (kGL_GrGLStandard == fStandard || fExtensions.has("GL_OES_mapbuffer")) {
- if (NULL == fFunctions.fMapBuffer ||
- NULL == fFunctions.fUnmapBuffer) {
+ if (nullptr == fFunctions.fMapBuffer ||
+ nullptr == fFunctions.fUnmapBuffer) {
RETURN_FALSE_INTERFACE
}
}
@@ -392,14 +392,14 @@ bool GrGLInterface::validate() const {
// Dual source blending
if (kGL_GrGLStandard == fStandard) {
if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_blend_func_extended")) {
- if (NULL == fFunctions.fBindFragDataLocationIndexed) {
+ if (nullptr == fFunctions.fBindFragDataLocationIndexed) {
RETURN_FALSE_INTERFACE
}
}
} else {
if (glVer >= GR_GL_VER(3,0) && fExtensions.has("GL_EXT_blend_func_extended")) {
- if (NULL == fFunctions.fBindFragDataLocation ||
- NULL == fFunctions.fBindFragDataLocationIndexed) {
+ if (nullptr == fFunctions.fBindFragDataLocation ||
+ nullptr == fFunctions.fBindFragDataLocationIndexed) {
RETURN_FALSE_INTERFACE
}
}
@@ -408,60 +408,60 @@ bool GrGLInterface::validate() const {
// glGetStringi was added in version 3.0 of both desktop and ES.
if (glVer >= GR_GL_VER(3, 0)) {
- if (NULL == fFunctions.fGetStringi) {
+ if (nullptr == fFunctions.fGetStringi) {
RETURN_FALSE_INTERFACE
}
}
if (kGL_GrGLStandard == fStandard) {
if (glVer >= GR_GL_VER(3, 0) || fExtensions.has("GL_ARB_vertex_array_object")) {
- if (NULL == fFunctions.fBindVertexArray ||
- NULL == fFunctions.fDeleteVertexArrays ||
- NULL == fFunctions.fGenVertexArrays) {
+ if (nullptr == fFunctions.fBindVertexArray ||
+ nullptr == fFunctions.fDeleteVertexArrays ||
+ nullptr == fFunctions.fGenVertexArrays) {
RETURN_FALSE_INTERFACE
}
}
} else {
if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_OES_vertex_array_object")) {
- if (NULL == fFunctions.fBindVertexArray ||
- NULL == fFunctions.fDeleteVertexArrays ||
- NULL == fFunctions.fGenVertexArrays) {
+ if (nullptr == fFunctions.fBindVertexArray ||
+ nullptr == fFunctions.fDeleteVertexArrays ||
+ nullptr == fFunctions.fGenVertexArrays) {
RETURN_FALSE_INTERFACE
}
}
}
if (fExtensions.has("GL_EXT_debug_marker")) {
- if (NULL == fFunctions.fInsertEventMarker ||
- NULL == fFunctions.fPushGroupMarker ||
- NULL == fFunctions.fPopGroupMarker) {
+ if (nullptr == fFunctions.fInsertEventMarker ||
+ nullptr == fFunctions.fPushGroupMarker ||
+ nullptr == fFunctions.fPopGroupMarker) {
RETURN_FALSE_INTERFACE
}
}
if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) ||
fExtensions.has("GL_ARB_invalidate_subdata")) {
- if (NULL == fFunctions.fInvalidateBufferData ||
- NULL == fFunctions.fInvalidateBufferSubData ||
- NULL == fFunctions.fInvalidateFramebuffer ||
- NULL == fFunctions.fInvalidateSubFramebuffer ||
- NULL == fFunctions.fInvalidateTexImage ||
- NULL == fFunctions.fInvalidateTexSubImage) {
+ if (nullptr == fFunctions.fInvalidateBufferData ||
+ nullptr == fFunctions.fInvalidateBufferSubData ||
+ nullptr == fFunctions.fInvalidateFramebuffer ||
+ nullptr == fFunctions.fInvalidateSubFramebuffer ||
+ nullptr == fFunctions.fInvalidateTexImage ||
+ nullptr == fFunctions.fInvalidateTexSubImage) {
RETURN_FALSE_INTERFACE;
}
} else if (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) {
// ES 3.0 adds the framebuffer functions but not the others.
- if (NULL == fFunctions.fInvalidateFramebuffer ||
- NULL == fFunctions.fInvalidateSubFramebuffer) {
+ if (nullptr == fFunctions.fInvalidateFramebuffer ||
+ nullptr == fFunctions.fInvalidateSubFramebuffer) {
RETURN_FALSE_INTERFACE;
}
}
if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_CHROMIUM_map_sub")) {
- if (NULL == fFunctions.fMapBufferSubData ||
- NULL == fFunctions.fMapTexSubImage2D ||
- NULL == fFunctions.fUnmapBufferSubData ||
- NULL == fFunctions.fUnmapTexSubImage2D) {
+ if (nullptr == fFunctions.fMapBufferSubData ||
+ nullptr == fFunctions.fMapTexSubImage2D ||
+ nullptr == fFunctions.fUnmapBufferSubData ||
+ nullptr == fFunctions.fUnmapTexSubImage2D) {
RETURN_FALSE_INTERFACE;
}
}
@@ -470,8 +470,8 @@ bool GrGLInterface::validate() const {
if (glVer >= GR_GL_VER(3,0) ||
(kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_range")) ||
(kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_range"))) {
- if (NULL == fFunctions.fMapBufferRange ||
- NULL == fFunctions.fFlushMappedBufferRange) {
+ if (nullptr == fFunctions.fMapBufferRange ||
+ nullptr == fFunctions.fFlushMappedBufferRange) {
RETURN_FALSE_INTERFACE;
}
}
@@ -479,7 +479,7 @@ bool GrGLInterface::validate() const {
if ((kGL_GrGLStandard == fStandard &&
(glVer >= GR_GL_VER(4,3) || fExtensions.has("GL_ARB_program_interface_query"))) ||
(kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1))) {
- if (NULL == fFunctions.fGetProgramResourceLocation) {
+ if (nullptr == fFunctions.fGetProgramResourceLocation) {
RETURN_FALSE_INTERFACE
}
}
@@ -487,59 +487,59 @@ bool GrGLInterface::validate() const {
if (kGLES_GrGLStandard == fStandard || glVer >= GR_GL_VER(4,1) ||
fExtensions.has("GL_ARB_ES2_compatibility")) {
#if 0 // Enable this once Chrome gives us the function ptr
- if (NULL == fFunctions.fGetShaderPrecisionFormat) {
+ if (nullptr == fFunctions.fGetShaderPrecisionFormat) {
RETURN_FALSE_INTERFACE
}
#endif
}
if (fExtensions.has("GL_NV_path_rendering") || fExtensions.has("GL_CHROMIUM_path_rendering")) {
- if (NULL == fFunctions.fMatrixLoadf ||
- NULL == fFunctions.fMatrixLoadIdentity ||
- NULL == fFunctions.fPathCommands ||
- NULL == fFunctions.fPathParameteri ||
- NULL == fFunctions.fPathParameterf ||
- NULL == fFunctions.fGenPaths ||
- NULL == fFunctions.fDeletePaths ||
- NULL == fFunctions.fIsPath ||
- NULL == fFunctions.fPathStencilFunc ||
- NULL == fFunctions.fStencilFillPath ||
- NULL == fFunctions.fStencilStrokePath ||
- NULL == fFunctions.fStencilFillPathInstanced ||
- NULL == fFunctions.fStencilStrokePathInstanced ||
- NULL == fFunctions.fCoverFillPath ||
- NULL == fFunctions.fCoverStrokePath ||
- NULL == fFunctions.fCoverFillPathInstanced ||
- NULL == fFunctions.fCoverStrokePathInstanced
+ if (nullptr == fFunctions.fMatrixLoadf ||
+ nullptr == fFunctions.fMatrixLoadIdentity ||
+ nullptr == fFunctions.fPathCommands ||
+ nullptr == fFunctions.fPathParameteri ||
+ nullptr == fFunctions.fPathParameterf ||
+ nullptr == fFunctions.fGenPaths ||
+ nullptr == fFunctions.fDeletePaths ||
+ nullptr == fFunctions.fIsPath ||
+ nullptr == fFunctions.fPathStencilFunc ||
+ nullptr == fFunctions.fStencilFillPath ||
+ nullptr == fFunctions.fStencilStrokePath ||
+ nullptr == fFunctions.fStencilFillPathInstanced ||
+ nullptr == fFunctions.fStencilStrokePathInstanced ||
+ nullptr == fFunctions.fCoverFillPath ||
+ nullptr == fFunctions.fCoverStrokePath ||
+ nullptr == fFunctions.fCoverFillPathInstanced ||
+ nullptr == fFunctions.fCoverStrokePathInstanced
#if 0
// List of functions that Skia uses, but which have been added since the initial release
// of NV_path_rendering driver. We do not want to fail interface validation due to
// missing features, we will just not use the extension.
// Update this list -> update GrGLCaps::hasPathRenderingSupport too.
- || NULL == fFunctions.fStencilThenCoverFillPath ||
- NULL == fFunctions.fStencilThenCoverStrokePath ||
- NULL == fFunctions.fStencilThenCoverFillPathInstanced ||
- NULL == fFunctions.fStencilThenCoverStrokePathInstanced ||
- NULL == fFunctions.fProgramPathFragmentInputGen
+ || nullptr == fFunctions.fStencilThenCoverFillPath ||
+ nullptr == fFunctions.fStencilThenCoverStrokePath ||
+ nullptr == fFunctions.fStencilThenCoverFillPathInstanced ||
+ nullptr == fFunctions.fStencilThenCoverStrokePathInstanced ||
+ nullptr == fFunctions.fProgramPathFragmentInputGen
#endif
) {
RETURN_FALSE_INTERFACE
}
if (fExtensions.has("GL_CHROMIUM_path_rendering")) {
- if (NULL == fFunctions.fBindFragmentInputLocation) {
+ if (nullptr == fFunctions.fBindFragmentInputLocation) {
RETURN_FALSE_INTERFACE
}
}
}
if (fExtensions.has("GL_EXT_raster_multisample")) {
- if (NULL == fFunctions.fRasterSamples) {
+ if (nullptr == fFunctions.fRasterSamples) {
RETURN_FALSE_INTERFACE
}
}
if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) {
- if (NULL == fFunctions.fCoverageModulation) {
+ if (nullptr == fFunctions.fCoverageModulation) {
RETURN_FALSE_INTERFACE
}
}
@@ -548,8 +548,8 @@ bool GrGLInterface::validate() const {
(kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) ||
fExtensions.has("GL_ARB_draw_instanced") ||
fExtensions.has("GL_EXT_draw_instanced")) {
- if (NULL == fFunctions.fDrawArraysInstanced ||
- NULL == fFunctions.fDrawElementsInstanced) {
+ if (nullptr == fFunctions.fDrawArraysInstanced ||
+ nullptr == fFunctions.fDrawElementsInstanced) {
RETURN_FALSE_INTERFACE
}
}
@@ -558,144 +558,144 @@ bool GrGLInterface::validate() const {
(kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) ||
fExtensions.has("GL_ARB_instanced_arrays") ||
fExtensions.has("GL_EXT_instanced_arrays")) {
- if (NULL == fFunctions.fVertexAttribDivisor) {
+ if (nullptr == fFunctions.fVertexAttribDivisor) {
RETURN_FALSE_INTERFACE
}
}
if (fExtensions.has("GL_NV_bindless_texture")) {
- if (NULL == fFunctions.fGetTextureHandle ||
- NULL == fFunctions.fGetTextureSamplerHandle ||
- NULL == fFunctions.fMakeTextureHandleResident ||
- NULL == fFunctions.fMakeTextureHandleNonResident ||
- NULL == fFunctions.fGetImageHandle ||
- NULL == fFunctions.fMakeImageHandleResident ||
- NULL == fFunctions.fMakeImageHandleNonResident ||
- NULL == fFunctions.fIsTextureHandleResident ||
- NULL == fFunctions.fIsImageHandleResident ||
- NULL == fFunctions.fUniformHandleui64 ||
- NULL == fFunctions.fUniformHandleui64v ||
- NULL == fFunctions.fProgramUniformHandleui64 ||
- NULL == fFunctions.fProgramUniformHandleui64v) {
+ if (nullptr == fFunctions.fGetTextureHandle ||
+ nullptr == fFunctions.fGetTextureSamplerHandle ||
+ nullptr == fFunctions.fMakeTextureHandleResident ||
+ nullptr == fFunctions.fMakeTextureHandleNonResident ||
+ nullptr == fFunctions.fGetImageHandle ||
+ nullptr == fFunctions.fMakeImageHandleResident ||
+ nullptr == fFunctions.fMakeImageHandleNonResident ||
+ nullptr == fFunctions.fIsTextureHandleResident ||
+ nullptr == fFunctions.fIsImageHandleResident ||
+ nullptr == fFunctions.fUniformHandleui64 ||
+ nullptr == fFunctions.fUniformHandleui64v ||
+ nullptr == fFunctions.fProgramUniformHandleui64 ||
+ nullptr == fFunctions.fProgramUniformHandleui64v) {
RETURN_FALSE_INTERFACE
}
}
if (kGL_GrGLStandard == fStandard && fExtensions.has("GL_EXT_direct_state_access")) {
- if (NULL == fFunctions.fTextureParameteri ||
- NULL == fFunctions.fTextureParameteriv ||
- NULL == fFunctions.fTextureParameterf ||
- NULL == fFunctions.fTextureParameterfv ||
- NULL == fFunctions.fTextureImage1D ||
- NULL == fFunctions.fTextureImage2D ||
- NULL == fFunctions.fTextureSubImage1D ||
- NULL == fFunctions.fTextureSubImage2D ||
- NULL == fFunctions.fCopyTextureImage1D ||
- NULL == fFunctions.fCopyTextureImage2D ||
- NULL == fFunctions.fCopyTextureSubImage1D ||
- NULL == fFunctions.fCopyTextureSubImage2D ||
- NULL == fFunctions.fGetTextureImage ||
- NULL == fFunctions.fGetTextureParameterfv ||
- NULL == fFunctions.fGetTextureParameteriv ||
- NULL == fFunctions.fGetTextureLevelParameterfv ||
- NULL == fFunctions.fGetTextureLevelParameteriv) {
+ if (nullptr == fFunctions.fTextureParameteri ||
+ nullptr == fFunctions.fTextureParameteriv ||
+ nullptr == fFunctions.fTextureParameterf ||
+ nullptr == fFunctions.fTextureParameterfv ||
+ nullptr == fFunctions.fTextureImage1D ||
+ nullptr == fFunctions.fTextureImage2D ||
+ nullptr == fFunctions.fTextureSubImage1D ||
+ nullptr == fFunctions.fTextureSubImage2D ||
+ nullptr == fFunctions.fCopyTextureImage1D ||
+ nullptr == fFunctions.fCopyTextureImage2D ||
+ nullptr == fFunctions.fCopyTextureSubImage1D ||
+ nullptr == fFunctions.fCopyTextureSubImage2D ||
+ nullptr == fFunctions.fGetTextureImage ||
+ nullptr == fFunctions.fGetTextureParameterfv ||
+ nullptr == fFunctions.fGetTextureParameteriv ||
+ nullptr == fFunctions.fGetTextureLevelParameterfv ||
+ nullptr == fFunctions.fGetTextureLevelParameteriv) {
RETURN_FALSE_INTERFACE
}
if (glVer >= GR_GL_VER(1,2)) {
- if (NULL == fFunctions.fTextureImage3D ||
- NULL == fFunctions.fTextureSubImage3D ||
- NULL == fFunctions.fCopyTextureSubImage3D ||
- NULL == fFunctions.fCompressedTextureImage3D ||
- NULL == fFunctions.fCompressedTextureImage2D ||
- NULL == fFunctions.fCompressedTextureImage1D ||
- NULL == fFunctions.fCompressedTextureSubImage3D ||
- NULL == fFunctions.fCompressedTextureSubImage2D ||
- NULL == fFunctions.fCompressedTextureSubImage1D ||
- NULL == fFunctions.fGetCompressedTextureImage) {
+ if (nullptr == fFunctions.fTextureImage3D ||
+ nullptr == fFunctions.fTextureSubImage3D ||
+ nullptr == fFunctions.fCopyTextureSubImage3D ||
+ nullptr == fFunctions.fCompressedTextureImage3D ||
+ nullptr == fFunctions.fCompressedTextureImage2D ||
+ nullptr == fFunctions.fCompressedTextureImage1D ||
+ nullptr == fFunctions.fCompressedTextureSubImage3D ||
+ nullptr == fFunctions.fCompressedTextureSubImage2D ||
+ nullptr == fFunctions.fCompressedTextureSubImage1D ||
+ nullptr == fFunctions.fGetCompressedTextureImage) {
RETURN_FALSE_INTERFACE
}
}
if (glVer >= GR_GL_VER(1,5)) {
- if (NULL == fFunctions.fNamedBufferData ||
- NULL == fFunctions.fNamedBufferSubData ||
- NULL == fFunctions.fMapNamedBuffer ||
- NULL == fFunctions.fUnmapNamedBuffer ||
- NULL == fFunctions.fGetNamedBufferParameteriv ||
- NULL == fFunctions.fGetNamedBufferPointerv ||
- NULL == fFunctions.fGetNamedBufferSubData) {
+ if (nullptr == fFunctions.fNamedBufferData ||
+ nullptr == fFunctions.fNamedBufferSubData ||
+ nullptr == fFunctions.fMapNamedBuffer ||
+ nullptr == fFunctions.fUnmapNamedBuffer ||
+ nullptr == fFunctions.fGetNamedBufferParameteriv ||
+ nullptr == fFunctions.fGetNamedBufferPointerv ||
+ nullptr == fFunctions.fGetNamedBufferSubData) {
RETURN_FALSE_INTERFACE
}
}
if (glVer >= GR_GL_VER(2,0)) {
- if (NULL == fFunctions.fProgramUniform1f ||
- NULL == fFunctions.fProgramUniform2f ||
- NULL == fFunctions.fProgramUniform3f ||
- NULL == fFunctions.fProgramUniform4f ||
- NULL == fFunctions.fProgramUniform1i ||
- NULL == fFunctions.fProgramUniform2i ||
- NULL == fFunctions.fProgramUniform3i ||
- NULL == fFunctions.fProgramUniform4i ||
- NULL == fFunctions.fProgramUniform1fv ||
- NULL == fFunctions.fProgramUniform2fv ||
- NULL == fFunctions.fProgramUniform3fv ||
- NULL == fFunctions.fProgramUniform4fv ||
- NULL == fFunctions.fProgramUniform1iv ||
- NULL == fFunctions.fProgramUniform2iv ||
- NULL == fFunctions.fProgramUniform3iv ||
- NULL == fFunctions.fProgramUniform4iv ||
- NULL == fFunctions.fProgramUniformMatrix2fv ||
- NULL == fFunctions.fProgramUniformMatrix3fv ||
- NULL == fFunctions.fProgramUniformMatrix4fv) {
+ if (nullptr == fFunctions.fProgramUniform1f ||
+ nullptr == fFunctions.fProgramUniform2f ||
+ nullptr == fFunctions.fProgramUniform3f ||
+ nullptr == fFunctions.fProgramUniform4f ||
+ nullptr == fFunctions.fProgramUniform1i ||
+ nullptr == fFunctions.fProgramUniform2i ||
+ nullptr == fFunctions.fProgramUniform3i ||
+ nullptr == fFunctions.fProgramUniform4i ||
+ nullptr == fFunctions.fProgramUniform1fv ||
+ nullptr == fFunctions.fProgramUniform2fv ||
+ nullptr == fFunctions.fProgramUniform3fv ||
+ nullptr == fFunctions.fProgramUniform4fv ||
+ nullptr == fFunctions.fProgramUniform1iv ||
+ nullptr == fFunctions.fProgramUniform2iv ||
+ nullptr == fFunctions.fProgramUniform3iv ||
+ nullptr == fFunctions.fProgramUniform4iv ||
+ nullptr == fFunctions.fProgramUniformMatrix2fv ||
+ nullptr == fFunctions.fProgramUniformMatrix3fv ||
+ nullptr == fFunctions.fProgramUniformMatrix4fv) {
RETURN_FALSE_INTERFACE
}
}
if (glVer >= GR_GL_VER(2,1)) {
- if (NULL == fFunctions.fProgramUniformMatrix2x3fv ||
- NULL == fFunctions.fProgramUniformMatrix3x2fv ||
- NULL == fFunctions.fProgramUniformMatrix2x4fv ||
- NULL == fFunctions.fProgramUniformMatrix4x2fv ||
- NULL == fFunctions.fProgramUniformMatrix3x4fv ||
- NULL == fFunctions.fProgramUniformMatrix4x3fv) {
+ if (nullptr == fFunctions.fProgramUniformMatrix2x3fv ||
+ nullptr == fFunctions.fProgramUniformMatrix3x2fv ||
+ nullptr == fFunctions.fProgramUniformMatrix2x4fv ||
+ nullptr == fFunctions.fProgramUniformMatrix4x2fv ||
+ nullptr == fFunctions.fProgramUniformMatrix3x4fv ||
+ nullptr == fFunctions.fProgramUniformMatrix4x3fv) {
RETURN_FALSE_INTERFACE
}
}
if (glVer >= GR_GL_VER(3,0)) {
- if (NULL == fFunctions.fNamedRenderbufferStorage ||
- NULL == fFunctions.fGetNamedRenderbufferParameteriv ||
- NULL == fFunctions.fNamedRenderbufferStorageMultisample ||
- NULL == fFunctions.fCheckNamedFramebufferStatus ||
- NULL == fFunctions.fNamedFramebufferTexture1D ||
- NULL == fFunctions.fNamedFramebufferTexture2D ||
- NULL == fFunctions.fNamedFramebufferTexture3D ||
- NULL == fFunctions.fNamedFramebufferRenderbuffer ||
- NULL == fFunctions.fGetNamedFramebufferAttachmentParameteriv ||
- NULL == fFunctions.fGenerateTextureMipmap ||
- NULL == fFunctions.fFramebufferDrawBuffer ||
- NULL == fFunctions.fFramebufferDrawBuffers ||
- NULL == fFunctions.fFramebufferReadBuffer ||
- NULL == fFunctions.fGetFramebufferParameteriv ||
- NULL == fFunctions.fNamedCopyBufferSubData ||
- NULL == fFunctions.fVertexArrayVertexOffset ||
- NULL == fFunctions.fVertexArrayColorOffset ||
- NULL == fFunctions.fVertexArrayEdgeFlagOffset ||
- NULL == fFunctions.fVertexArrayIndexOffset ||
- NULL == fFunctions.fVertexArrayNormalOffset ||
- NULL == fFunctions.fVertexArrayTexCoordOffset ||
- NULL == fFunctions.fVertexArrayMultiTexCoordOffset ||
- NULL == fFunctions.fVertexArrayFogCoordOffset ||
- NULL == fFunctions.fVertexArraySecondaryColorOffset ||
- NULL == fFunctions.fVertexArrayVertexAttribOffset ||
- NULL == fFunctions.fVertexArrayVertexAttribIOffset ||
- NULL == fFunctions.fEnableVertexArray ||
- NULL == fFunctions.fDisableVertexArray ||
- NULL == fFunctions.fEnableVertexArrayAttrib ||
- NULL == fFunctions.fDisableVertexArrayAttrib ||
- NULL == fFunctions.fGetVertexArrayIntegerv ||
- NULL == fFunctions.fGetVertexArrayPointerv ||
- NULL == fFunctions.fGetVertexArrayIntegeri_v ||
- NULL == fFunctions.fGetVertexArrayPointeri_v ||
- NULL == fFunctions.fMapNamedBufferRange ||
- NULL == fFunctions.fFlushMappedNamedBufferRange) {
+ if (nullptr == fFunctions.fNamedRenderbufferStorage ||
+ nullptr == fFunctions.fGetNamedRenderbufferParameteriv ||
+ nullptr == fFunctions.fNamedRenderbufferStorageMultisample ||
+ nullptr == fFunctions.fCheckNamedFramebufferStatus ||
+ nullptr == fFunctions.fNamedFramebufferTexture1D ||
+ nullptr == fFunctions.fNamedFramebufferTexture2D ||
+ nullptr == fFunctions.fNamedFramebufferTexture3D ||
+ nullptr == fFunctions.fNamedFramebufferRenderbuffer ||
+ nullptr == fFunctions.fGetNamedFramebufferAttachmentParameteriv ||
+ nullptr == fFunctions.fGenerateTextureMipmap ||
+ nullptr == fFunctions.fFramebufferDrawBuffer ||
+ nullptr == fFunctions.fFramebufferDrawBuffers ||
+ nullptr == fFunctions.fFramebufferReadBuffer ||
+ nullptr == fFunctions.fGetFramebufferParameteriv ||
+ nullptr == fFunctions.fNamedCopyBufferSubData ||
+ nullptr == fFunctions.fVertexArrayVertexOffset ||
+ nullptr == fFunctions.fVertexArrayColorOffset ||
+ nullptr == fFunctions.fVertexArrayEdgeFlagOffset ||
+ nullptr == fFunctions.fVertexArrayIndexOffset ||
+ nullptr == fFunctions.fVertexArrayNormalOffset ||
+ nullptr == fFunctions.fVertexArrayTexCoordOffset ||
+ nullptr == fFunctions.fVertexArrayMultiTexCoordOffset ||
+ nullptr == fFunctions.fVertexArrayFogCoordOffset ||
+ nullptr == fFunctions.fVertexArraySecondaryColorOffset ||
+ nullptr == fFunctions.fVertexArrayVertexAttribOffset ||
+ nullptr == fFunctions.fVertexArrayVertexAttribIOffset ||
+ nullptr == fFunctions.fEnableVertexArray ||
+ nullptr == fFunctions.fDisableVertexArray ||
+ nullptr == fFunctions.fEnableVertexArrayAttrib ||
+ nullptr == fFunctions.fDisableVertexArrayAttrib ||
+ nullptr == fFunctions.fGetVertexArrayIntegerv ||
+ nullptr == fFunctions.fGetVertexArrayPointerv ||
+ nullptr == fFunctions.fGetVertexArrayIntegeri_v ||
+ nullptr == fFunctions.fGetVertexArrayPointeri_v ||
+ nullptr == fFunctions.fMapNamedBufferRange ||
+ nullptr == fFunctions.fFlushMappedNamedBufferRange) {
RETURN_FALSE_INTERFACE
}
}
@@ -703,13 +703,13 @@ bool GrGLInterface::validate() const {
if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) ||
fExtensions.has("GL_KHR_debug")) {
- if (NULL == fFunctions.fDebugMessageControl ||
- NULL == fFunctions.fDebugMessageInsert ||
- NULL == fFunctions.fDebugMessageCallback ||
- NULL == fFunctions.fGetDebugMessageLog ||
- NULL == fFunctions.fPushDebugGroup ||
- NULL == fFunctions.fPopDebugGroup ||
- NULL == fFunctions.fObjectLabel) {
+ if (nullptr == fFunctions.fDebugMessageControl ||
+ nullptr == fFunctions.fDebugMessageInsert ||
+ nullptr == fFunctions.fDebugMessageCallback ||
+ nullptr == fFunctions.fGetDebugMessageLog ||
+ nullptr == fFunctions.fPushDebugGroup ||
+ nullptr == fFunctions.fPopDebugGroup ||
+ nullptr == fFunctions.fObjectLabel) {
RETURN_FALSE_INTERFACE
}
}
diff --git a/src/gpu/gl/GrGLNameAllocator.cpp b/src/gpu/gl/GrGLNameAllocator.cpp
index 49d4564fb9..03123a6d86 100644
--- a/src/gpu/gl/GrGLNameAllocator.cpp
+++ b/src/gpu/gl/GrGLNameAllocator.cpp
@@ -64,7 +64,7 @@ public:
*
* @param removedCount A pointer that receives the size of the contiguous
range that was removed.
- * @return The resulting SparseNameRange after the removal (or NULL if it
+ * @return The resulting SparseNameRange after the removal (or nullptr if it
* became empty). Note that this call is destructive, so the
* original SparseNameRange will no longer be valid afterward. The
* caller must always update its pointer with the new
@@ -100,7 +100,7 @@ public:
*
* @param name The name to free. Not-allocated names are silently ignored
* the same way they are in the OpenGL spec.
- * @return The resulting SparseNameRange after the free (or NULL if it
+ * @return The resulting SparseNameRange after the free (or nullptr if it
* became empty). Note that this call is destructive, so the
* original SparseNameRange will no longer be valid afterward. The
* caller must always update its pointer with the new
@@ -146,7 +146,7 @@ public:
GrGLuint removedCount;
fRight.reset(fRight->removeLeftmostContiguousRange(&removedCount));
*outName = fLeft->appendNames(1 + removedCount);
- if (NULL == fRight.get()) {
+ if (nullptr == fRight.get()) {
return fLeft.detach();
}
this->updateStats();
@@ -162,7 +162,7 @@ public:
SparseNameRange* SK_WARN_UNUSED_RESULT removeLeftmostContiguousRange(GrGLuint* removedCount) override {
fLeft.reset(fLeft->removeLeftmostContiguousRange(removedCount));
- if (NULL == fLeft) {
+ if (nullptr == fLeft) {
return fRight.detach();
}
this->updateStats();
@@ -188,7 +188,7 @@ public:
SparseNameRange* SK_WARN_UNUSED_RESULT free(GrGLuint name) override {
if (name < fLeft->end()) {
fLeft.reset(fLeft->free(name));
- if (NULL == fLeft) {
+ if (nullptr == fLeft) {
// fLeft became empty after the free.
return fRight.detach();
}
@@ -196,7 +196,7 @@ public:
return this->rebalance();
} else {
fRight.reset(fRight->free(name));
- if (NULL == fRight) {
+ if (nullptr == fRight) {
// fRight became empty after the free.
return fLeft.detach();
}
@@ -287,7 +287,7 @@ public:
SparseNameRange* SK_WARN_UNUSED_RESULT removeLeftmostContiguousRange(GrGLuint* removedCount) override {
*removedCount = fEnd - fFirst;
- return NULL;
+ return nullptr;
}
GrGLuint appendNames(GrGLuint count) override {
@@ -311,7 +311,7 @@ public:
if (fFirst == name) {
++fFirst;
- return (fEnd == fFirst) ? NULL : this->takeRef();
+ return (fEnd == fFirst) ? nullptr : this->takeRef();
}
if (fEnd == name + 1) {
@@ -337,7 +337,7 @@ GrGLNameAllocator::~GrGLNameAllocator() {
}
GrGLuint GrGLNameAllocator::allocateName() {
- if (NULL == fAllocatedNames.get()) {
+ if (nullptr == fAllocatedNames.get()) {
fAllocatedNames.reset(new ContiguousNameRange(fFirstName, fFirstName + 1));
return fFirstName;
}
diff --git a/src/gpu/gl/GrGLNoOpInterface.cpp b/src/gpu/gl/GrGLNoOpInterface.cpp
index f47f254424..113c47d054 100644
--- a/src/gpu/gl/GrGLNoOpInterface.cpp
+++ b/src/gpu/gl/GrGLNoOpInterface.cpp
@@ -642,7 +642,7 @@ const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetString(GrGLenum name) {
return (const GrGLubyte*)"The Debug (Non-)Renderer";
default:
SkFAIL("Unexpected name passed to GetString");
- return NULL;
+ return nullptr;
}
}
@@ -652,11 +652,11 @@ const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetStringi(GrGLenum name, GrGLuint i)
if (static_cast<size_t>(i) <= SK_ARRAY_COUNT(kExtensions)) {
return (const GrGLubyte*) kExtensions[i];
} else {
- return NULL;
+ return nullptr;
}
default:
SkFAIL("Unexpected name passed to GetStringi");
- return NULL;
+ return nullptr;
}
}
diff --git a/src/gpu/gl/GrGLPath.cpp b/src/gpu/gl/GrGLPath.cpp
index 9a4aa0cbef..1dfeaee7b3 100644
--- a/src/gpu/gl/GrGLPath.cpp
+++ b/src/gpu/gl/GrGLPath.cpp
@@ -166,7 +166,7 @@ void GrGLPath::InitPathObject(GrGLGpu* gpu,
GR_GL_CALL(gpu->glInterface(), PathCommands(pathID, pathCommands.count(), &pathCommands[0],
pathCoords.count(), GR_GL_FLOAT, &pathCoords[0]));
} else {
- GR_GL_CALL(gpu->glInterface(), PathCommands(pathID, 0, NULL, 0, GR_GL_FLOAT, NULL));
+ GR_GL_CALL(gpu->glInterface(), PathCommands(pathID, 0, nullptr, 0, GR_GL_FLOAT, nullptr));
}
if (stroke.needToApply()) {
diff --git a/src/gpu/gl/GrGLPathRange.cpp b/src/gpu/gl/GrGLPathRange.cpp
index 071fa4269e..bd213d4e09 100644
--- a/src/gpu/gl/GrGLPathRange.cpp
+++ b/src/gpu/gl/GrGLPathRange.cpp
@@ -46,7 +46,7 @@ void GrGLPathRange::init() {
void GrGLPathRange::onInitPath(int index, const SkPath& origSkPath) const {
GrGLGpu* gpu = static_cast<GrGLGpu*>(this->getGpu());
- if (NULL == gpu) {
+ if (nullptr == gpu) {
return;
}
diff --git a/src/gpu/gl/GrGLPathRendering.cpp b/src/gpu/gl/GrGLPathRendering.cpp
index 22b12bf988..78f78baf9d 100644
--- a/src/gpu/gl/GrGLPathRendering.cpp
+++ b/src/gpu/gl/GrGLPathRendering.cpp
@@ -63,14 +63,14 @@ GrGLPathRendering::GrGLPathRendering(GrGLGpu* gpu)
: GrPathRendering(gpu) {
const GrGLInterface* glInterface = gpu->glInterface();
fCaps.bindFragmentInputSupport =
- NULL != glInterface->fFunctions.fBindFragmentInputLocation;
+ nullptr != glInterface->fFunctions.fBindFragmentInputLocation;
}
GrGLPathRendering::~GrGLPathRendering() {
}
void GrGLPathRendering::abandonGpuResources() {
- fPathNameAllocator.reset(NULL);
+ fPathNameAllocator.reset(nullptr);
}
void GrGLPathRendering::resetContext() {
@@ -101,7 +101,7 @@ void GrGLPathRendering::onStencilPath(const StencilPathArgs& args, const GrPath*
this->setProjectionMatrix(*args.fViewMatrix, size, rt->origin());
gpu->flushScissor(*args.fScissor, rt->getViewport(), rt->origin());
gpu->flushHWAAState(rt, args.fUseHWAA);
- gpu->flushRenderTarget(rt, NULL);
+ gpu->flushRenderTarget(rt, nullptr);
const GrGLPath* glPath = static_cast<const GrGLPath*>(path);
@@ -236,7 +236,7 @@ GrGLuint GrGLPathRendering::genPaths(GrGLsizei range) {
return name;
}
- if (NULL == fPathNameAllocator.get()) {
+ if (nullptr == fPathNameAllocator.get()) {
static const int range = 65536;
GrGLuint firstName;
GL_CALL_RET(firstName, GenPaths(range));
@@ -259,14 +259,14 @@ void GrGLPathRendering::deletePaths(GrGLuint path, GrGLsizei range) {
if (range > 1) {
// It is not supported to delete names in ranges that were allocated
// individually using GrGLPathNameAllocator.
- SkASSERT(NULL == fPathNameAllocator.get() ||
+ SkASSERT(nullptr == fPathNameAllocator.get() ||
path + range <= fPathNameAllocator->firstName() ||
path >= fPathNameAllocator->endName());
GL_CALL(DeletePaths(path, range));
return;
}
- if (NULL == fPathNameAllocator.get() ||
+ if (nullptr == fPathNameAllocator.get() ||
path < fPathNameAllocator->firstName() ||
path >= fPathNameAllocator->endName()) {
// If we aren't inside fPathNameAllocator's range then this name was
@@ -276,7 +276,7 @@ void GrGLPathRendering::deletePaths(GrGLuint path, GrGLsizei range) {
}
// Make the path empty to save memory, but don't free the name in the driver.
- GL_CALL(PathCommands(path, 0, NULL, 0, GR_GL_FLOAT, NULL));
+ GL_CALL(PathCommands(path, 0, nullptr, 0, GR_GL_FLOAT, nullptr));
fPathNameAllocator->free(path);
}
diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp
index 34276e2c40..5579701796 100644
--- a/src/gpu/gl/GrGLUtil.cpp
+++ b/src/gpu/gl/GrGLUtil.cpp
@@ -63,8 +63,8 @@ void GrGLCheckErr(const GrGLInterface* gl,
///////////////////////////////////////////////////////////////////////////////
GrGLStandard GrGLGetStandardInUseFromString(const char* versionString) {
- if (NULL == versionString) {
- SkDebugf("NULL GL version string.");
+ if (nullptr == versionString) {
+ SkDebugf("nullptr GL version string.");
return kNone_GrGLStandard;
}
@@ -165,8 +165,8 @@ void GrGLGetDriverInfo(GrGLStandard standard,
}
GrGLVersion GrGLGetVersionFromString(const char* versionString) {
- if (NULL == versionString) {
- SkDebugf("NULL GL version string.");
+ if (nullptr == versionString) {
+ SkDebugf("nullptr GL version string.");
return GR_GL_INVALID_VER;
}
@@ -200,8 +200,8 @@ GrGLVersion GrGLGetVersionFromString(const char* versionString) {
}
GrGLSLVersion GrGLGetGLSLVersionFromString(const char* versionString) {
- if (NULL == versionString) {
- SkDebugf("NULL GLSL version string.");
+ if (nullptr == versionString) {
+ SkDebugf("nullptr GLSL version string.");
return GR_GLSL_INVALID_VER;
}
diff --git a/src/gpu/gl/GrGLVertexArray.cpp b/src/gpu/gl/GrGLVertexArray.cpp
index 265b5b35ea..8cfa8d6550 100644
--- a/src/gpu/gl/GrGLVertexArray.cpp
+++ b/src/gpu/gl/GrGLVertexArray.cpp
@@ -75,7 +75,7 @@ GrGLVertexArray::GrGLVertexArray(GrGLint id, int attribCount)
GrGLAttribArrayState* GrGLVertexArray::bind(GrGLGpu* gpu) {
if (0 == fID) {
- return NULL;
+ return nullptr;
}
gpu->bindVertexArray(fID);
return &fAttribArrays;
diff --git a/src/gpu/gl/GrGLVertexArray.h b/src/gpu/gl/GrGLVertexArray.h
index afb23c5d20..66bc14297e 100644
--- a/src/gpu/gl/GrGLVertexArray.h
+++ b/src/gpu/gl/GrGLVertexArray.h
@@ -137,7 +137,7 @@ public:
GrGLVertexArray(GrGLint id, int attribCount);
/**
- * Binds this vertex array. If the ID has been deleted or abandoned then NULL is returned.
+ * Binds this vertex array. If the ID has been deleted or abandoned then nullptr is returned.
* Otherwise, the GrGLAttribArrayState that is tracking this vertex array's attrib bindings is
* returned.
*/
diff --git a/src/gpu/gl/GrGLVertexBuffer.cpp b/src/gpu/gl/GrGLVertexBuffer.cpp
index 61936f25bf..cd9d52a280 100644
--- a/src/gpu/gl/GrGLVertexBuffer.cpp
+++ b/src/gpu/gl/GrGLVertexBuffer.cpp
@@ -31,7 +31,7 @@ void* GrGLVertexBuffer::onMap() {
if (!this->wasDestroyed()) {
return fImpl.map(this->getGpuGL());
} else {
- return NULL;
+ return nullptr;
}
}
diff --git a/src/gpu/gl/SkGLContext.cpp b/src/gpu/gl/SkGLContext.cpp
index 75fbf2bac5..ec318cb80d 100644
--- a/src/gpu/gl/SkGLContext.cpp
+++ b/src/gpu/gl/SkGLContext.cpp
@@ -49,8 +49,8 @@ SkGLContext::~SkGLContext() {
SkASSERT(0 == fFrameFences[i]);
}
#endif
- SkASSERT(NULL == fGL.get());
- SkASSERT(NULL == fFenceSync.get());
+ SkASSERT(nullptr == fGL.get());
+ SkASSERT(nullptr == fFenceSync.get());
}
void SkGLContext::init(const GrGLInterface* gl, SkGpuFenceSync* fenceSync) {
@@ -67,10 +67,10 @@ void SkGLContext::teardown() {
fFrameFences[i] = 0;
}
}
- fFenceSync.reset(NULL);
+ fFenceSync.reset(nullptr);
}
- fGL.reset(NULL);
+ fGL.reset(nullptr);
}
void SkGLContext::makeCurrent() const {
@@ -112,7 +112,7 @@ SkGLContext::GLFenceSync* SkGLContext::GLFenceSync::CreateIfSupported(const SkGL
SK_GL_RET(*ctx, versionStr, GetString(GR_GL_VERSION));
GrGLVersion version = GrGLGetVersionFromString(reinterpret_cast<const char*>(versionStr));
if (version < GR_GL_VER(3,2) && !ctx->gl()->hasExtension("GL_ARB_sync")) {
- return NULL;
+ return nullptr;
}
ret->fGLFenceSync = reinterpret_cast<GLFenceSyncProc>(
ctx->onPlatformGetProcAddress("glFenceSync"));
@@ -122,7 +122,7 @@ SkGLContext::GLFenceSync* SkGLContext::GLFenceSync::CreateIfSupported(const SkGL
ctx->onPlatformGetProcAddress("glDeleteSync"));
} else {
if (!ctx->gl()->hasExtension("GL_APPLE_sync")) {
- return NULL;
+ return nullptr;
}
ret->fGLFenceSync = reinterpret_cast<GLFenceSyncProc>(
ctx->onPlatformGetProcAddress("glFenceSyncAPPLE"));
@@ -133,7 +133,7 @@ SkGLContext::GLFenceSync* SkGLContext::GLFenceSync::CreateIfSupported(const SkGL
}
if (!ret->fGLFenceSync || !ret->fGLClientWaitSync || !ret->fGLDeleteSync) {
- return NULL;
+ return nullptr;
}
return ret.detach();
diff --git a/src/gpu/gl/SkNullGLContext.cpp b/src/gpu/gl/SkNullGLContext.cpp
index dddea763ad..877eed9d77 100644
--- a/src/gpu/gl/SkNullGLContext.cpp
+++ b/src/gpu/gl/SkNullGLContext.cpp
@@ -21,7 +21,7 @@ class BufferObj {
public:
- BufferObj(GrGLuint id) : fID(id), fDataPtr(NULL), fSize(0), fMapped(false) {}
+ BufferObj(GrGLuint id) : fID(id), fDataPtr(nullptr), fSize(0), fMapped(false) {}
~BufferObj() { delete[] fDataPtr; }
void allocate(GrGLsizeiptr size, const GrGLchar* dataPtr) {
@@ -56,11 +56,11 @@ public:
BufferManager() : fFreeListHead(kFreeListEnd) {}
~BufferManager() {
- // NULL out the entries that are really free list links rather than ptrs before deleting.
+ // nullptr out the entries that are really free list links rather than ptrs before deleting.
intptr_t curr = fFreeListHead;
while (kFreeListEnd != curr) {
intptr_t next = reinterpret_cast<intptr_t>(fBuffers[SkToS32(curr)]);
- fBuffers[SkToS32(curr)] = NULL;
+ fBuffers[SkToS32(curr)] = nullptr;
curr = next;
}
@@ -254,7 +254,7 @@ GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBufferRange(GrGLenum target, GrGLintptr o
buffer->setMapped(true);
return buffer->dataPtr();
}
- return NULL;
+ return nullptr;
}
GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBuffer(GrGLenum target, GrGLenum access) {
@@ -277,7 +277,7 @@ GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBuffer(GrGLenum target, GrGLenum access)
}
SkASSERT(false);
- return NULL; // no buffer bound to target
+ return nullptr; // no buffer bound to target
}
GrGLvoid GR_GL_FUNCTION_TYPE nullGLFlushMappedBufferRange(GrGLenum target,
@@ -499,7 +499,7 @@ static GrGLInterface* create_null_interface(State* state) {
static void* create_tls() {
State** current = new State*;
- *current = NULL;
+ *current = nullptr;
return current;
}
@@ -534,12 +534,12 @@ static void set_current_context_from_interface(const GrGLInterface* interface) {
SkNullGLContext* SkNullGLContext::Create(GrGLStandard forcedGpuAPI) {
if (kGLES_GrGLStandard == forcedGpuAPI) {
- return NULL;
+ return nullptr;
}
SkNullGLContext* ctx = new SkNullGLContext;
if (!ctx->isValid()) {
delete ctx;
- return NULL;
+ return nullptr;
}
return ctx;
}
diff --git a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
index 4569cc8f23..39a6673b99 100644
--- a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
+++ b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
@@ -13,7 +13,7 @@
#include <GLES2/gl2.h>
static GrGLFuncPtr android_get_gl_proc(void* ctx, const char name[]) {
- SkASSERT(NULL == ctx);
+ SkASSERT(nullptr == ctx);
// Some older drivers on Android have busted eglGetProcAdddress Functions that
// will return the wrong pointer for built in GLES2 functions. This set of functions
// was generated on a Xoom by finding mismatches between the function pulled in via gl2.h and
@@ -225,5 +225,5 @@ static GrGLFuncPtr android_get_gl_proc(void* ctx, const char name[]) {
}
const GrGLInterface* GrGLCreateNativeInterface() {
- return GrGLAssembleInterface(NULL, android_get_gl_proc);
+ return GrGLAssembleInterface(nullptr, android_get_gl_proc);
}
diff --git a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
index e4f5467842..4f26c06afe 100644
--- a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
+++ b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
@@ -24,15 +24,15 @@ static GrGLFuncPtr angle_get_gl_proc(void* ctx, const char name[]) {
const GrGLInterface* GrGLCreateANGLEInterface() {
- static HMODULE ghANGLELib = NULL;
+ static HMODULE ghANGLELib = nullptr;
- if (NULL == ghANGLELib) {
+ if (nullptr == ghANGLELib) {
// We load the ANGLE library and never let it go
ghANGLELib = LoadLibrary("libGLESv2.dll");
}
- if (NULL == ghANGLELib) {
+ if (nullptr == ghANGLELib) {
// We can't setup the interface correctly w/o the DLL
- return NULL;
+ return nullptr;
}
return GrGLAssembleGLESInterface(ghANGLELib, angle_get_gl_proc);
diff --git a/src/gpu/gl/angle/SkANGLEGLContext.cpp b/src/gpu/gl/angle/SkANGLEGLContext.cpp
index db34c563ea..8ebdcb661e 100644
--- a/src/gpu/gl/angle/SkANGLEGLContext.cpp
+++ b/src/gpu/gl/angle/SkANGLEGLContext.cpp
@@ -80,7 +80,7 @@ SkANGLEGLContext::SkANGLEGLContext()
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};
- fContext = eglCreateContext(fDisplay, surfaceConfig, NULL, contextAttribs);
+ fContext = eglCreateContext(fDisplay, surfaceConfig, nullptr, contextAttribs);
static const EGLint surfaceAttribs[] = {
@@ -94,7 +94,7 @@ SkANGLEGLContext::SkANGLEGLContext()
eglMakeCurrent(fDisplay, fSurface, fSurface, fContext);
SkAutoTUnref<const GrGLInterface> gl(GrGLCreateANGLEInterface());
- if (NULL == gl.get()) {
+ if (nullptr == gl.get()) {
SkDebugf("Could not create ANGLE GL interface!\n");
this->destroyGLContext();
return;
diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h
index 8746fffb8b..912de0a645 100644
--- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h
+++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h
@@ -112,7 +112,7 @@ class GrGLXPFragmentBuilder : public GrGLFragmentBuilder {
public:
GrGLXPFragmentBuilder(GrGLProgramBuilder* program) : INHERITED(program) {}
- /** Returns the variable name that holds the color of the destination pixel. This may be NULL if
+ /** Returns the variable name that holds the color of the destination pixel. This may be nullptr if
no effect advertised that it will read the destination. */
virtual const char* dstColor() = 0;
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index d0eb4d4865..e6e93e9f28 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -43,7 +43,7 @@ GrGLProgram* GrGLProgramBuilder::CreateProgram(const DrawArgs& args, GrGLGpu* gp
GrGLSLExpr4 inputCoverage;
if (!pb->emitAndInstallProcs(&inputColor, &inputCoverage)) {
- return NULL;
+ return nullptr;
}
return pb->finalize();
@@ -69,8 +69,8 @@ GrGLProgramBuilder::GrGLProgramBuilder(GrGLGpu* gpu, const DrawArgs& args)
, fFS(this, args.fDesc->header().fFragPosKey)
, fOutOfStage(true)
, fStageIndex(-1)
- , fGeometryProcessor(NULL)
- , fXferProcessor(NULL)
+ , fGeometryProcessor(nullptr)
+ , fXferProcessor(nullptr)
, fArgs(args)
, fGpu(gpu)
, fUniforms(kVarsPerBlock)
@@ -252,7 +252,7 @@ void GrGLProgramBuilder::emitAndInstallProc(const GrFragmentProcessor& fp,
openBrace.printf("{ // Stage %d, %s\n", fStageIndex, fp.name());
fFS.codeAppend(openBrace.c_str());
- this->emitAndInstallProc(fp, index, output->c_str(), input.isOnes() ? NULL : input.c_str());
+ this->emitAndInstallProc(fp, index, output->c_str(), input.isOnes() ? nullptr : input.c_str());
fFS.codeAppend("}");
}
@@ -390,7 +390,7 @@ GrGLProgram* GrGLProgramBuilder::finalize() {
GrGLuint programID;
GL_CALL_RET(programID, CreateProgram());
if (0 == programID) {
- return NULL;
+ return nullptr;
}
// compile shaders and bind attributes / uniforms
@@ -398,7 +398,7 @@ GrGLProgram* GrGLProgramBuilder::finalize() {
if (!fVS.compileAndAttachShaders(programID, &shadersToDelete)) {
this->cleanupProgram(programID, shadersToDelete);
- return NULL;
+ return nullptr;
}
// NVPR actually requires a vertex shader to compile
@@ -409,7 +409,7 @@ GrGLProgram* GrGLProgramBuilder::finalize() {
if (!fFS.compileAndAttachShaders(programID, &shadersToDelete)) {
this->cleanupProgram(programID, shadersToDelete);
- return NULL;
+ return nullptr;
}
this->bindProgramResourceLocations(programID);
@@ -432,7 +432,7 @@ GrGLProgram* GrGLProgramBuilder::finalize() {
}
void GrGLProgramBuilder::bindProgramResourceLocations(GrGLuint programID) {
- bool usingBindUniform = fGpu->glInterface()->fFunctions.fBindUniformLocation != NULL;
+ bool usingBindUniform = fGpu->glInterface()->fFunctions.fBindUniformLocation != nullptr;
if (usingBindUniform) {
int count = fUniforms.count();
for (int i = 0; i < count; ++i) {
@@ -469,7 +469,7 @@ bool GrGLProgramBuilder::checkLinkStatus(GrGLuint programID) {
}
void GrGLProgramBuilder::resolveProgramResourceLocations(GrGLuint programID) {
- bool usingBindUniform = fGpu->glInterface()->fFunctions.fBindUniformLocation != NULL;
+ bool usingBindUniform = fGpu->glInterface()->fFunctions.fBindUniformLocation != nullptr;
if (!usingBindUniform) {
int count = fUniforms.count();
for (int i = 0; i < count; ++i) {
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.h b/src/gpu/gl/builders/GrGLProgramBuilder.h
index 06d0fa0744..1d5e5fbcfe 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.h
@@ -49,14 +49,14 @@ public:
/** Add a uniform variable to the current program, that has visibility in one or more shaders.
visibility is a bitfield of ShaderVisibility values indicating from which shaders the
uniform should be accessible. At least one bit must be set. Geometry shader uniforms are not
- supported at this time. The actual uniform name will be mangled. If outName is not NULL then
+ supported at this time. The actual uniform name will be mangled. If outName is not nullptr then
it will refer to the final uniform name after return. Use the addUniformArray variant to add
an array of uniforms. */
UniformHandle addUniform(uint32_t visibility,
GrSLType type,
GrSLPrecision precision,
const char* name,
- const char** outName = NULL) {
+ const char** outName = nullptr) {
return this->addUniformArray(visibility, type, precision, name, 0, outName);
}
@@ -66,7 +66,7 @@ public:
GrSLPrecision precision,
const char* name,
int arrayCount,
- const char** outName = NULL) = 0;
+ const char** outName = nullptr) = 0;
virtual const GrGLShaderVar& getUniformVariable(UniformHandle u) const = 0;
@@ -105,8 +105,8 @@ protected:
};
GrGLVarying(GrSLType type, Varying varying)
- : fVarying(varying), fType(type), fVsOut(NULL), fGsIn(NULL), fGsOut(NULL),
- fFsIn(NULL) {}
+ : fVarying(varying), fType(type), fVsOut(nullptr), fGsIn(nullptr), fGsOut(nullptr),
+ fFsIn(nullptr) {}
Varying fVarying;
diff --git a/src/gpu/gl/builders/GrGLShaderBuilder.cpp b/src/gpu/gl/builders/GrGLShaderBuilder.cpp
index f0408afe21..84c3c6522c 100644
--- a/src/gpu/gl/builders/GrGLShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLShaderBuilder.cpp
@@ -58,7 +58,7 @@ GrGLShaderBuilder::GrGLShaderBuilder(GrGLProgramBuilder* program)
// We push back some dummy pointers which will later become our header
for (int i = 0; i <= kCode; i++) {
fShaderStrings.push_back();
- fCompilerStrings.push_back(NULL);
+ fCompilerStrings.push_back(nullptr);
fCompilerStringLengths.push_back(0);
}
diff --git a/src/gpu/gl/builders/GrGLShaderBuilder.h b/src/gpu/gl/builders/GrGLShaderBuilder.h
index 4a6d2e13d8..427c6590ac 100644
--- a/src/gpu/gl/builders/GrGLShaderBuilder.h
+++ b/src/gpu/gl/builders/GrGLShaderBuilder.h
@@ -57,7 +57,7 @@ public:
/** Does the work of appendTextureLookup and modulates the result by modulation. The result is
always a vec4. modulation and the swizzle specified by TextureSampler must both be vec4 or
- float. If modulation is "" or NULL it this function acts as though appendTextureLookup were
+ float. If modulation is "" or nullptr it this function acts as though appendTextureLookup were
called. */
void appendTextureLookupAndModulate(const char* modulation,
const TextureSampler&,
diff --git a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
index 983de21021..0189932cac 100644
--- a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
@@ -15,7 +15,7 @@
GrGLVertexBuilder::GrGLVertexBuilder(GrGLProgramBuilder* program)
: INHERITED(program)
- , fRtAdjustName(NULL) {
+ , fRtAdjustName(nullptr) {
}
void GrGLVertexBuilder::addVarying(const char* name, GrGLVarying* v) {
diff --git a/src/gpu/gl/debug/GrBufferObj.h b/src/gpu/gl/debug/GrBufferObj.h
index 3c7a30b6d3..65b1caf820 100644
--- a/src/gpu/gl/debug/GrBufferObj.h
+++ b/src/gpu/gl/debug/GrBufferObj.h
@@ -19,7 +19,7 @@ class GrBufferObj : public GrFakeRefObj {
public:
GrBufferObj()
: GrFakeRefObj()
- , fDataPtr(NULL)
+ , fDataPtr(nullptr)
, fMapped(false)
, fBound(false)
, fSize(0)
diff --git a/src/gpu/gl/debug/GrDebugGL.cpp b/src/gpu/gl/debug/GrDebugGL.cpp
index ad06862bd7..2de349bc38 100644
--- a/src/gpu/gl/debug/GrDebugGL.cpp
+++ b/src/gpu/gl/debug/GrDebugGL.cpp
@@ -16,7 +16,7 @@
#include "GrTextureUnitObj.h"
#include "GrVertexArrayObj.h"
-GrDebugGL* GrDebugGL::gObj = NULL;
+GrDebugGL* GrDebugGL::gObj = nullptr;
int GrDebugGL::gStaticRefCount = 0;
GrDebugGL::Create GrDebugGL::gFactoryFunc[kObjTypeCount] = {
GrTextureObj::createGrTextureObj,
@@ -34,13 +34,13 @@ GrDebugGL::GrDebugGL()
: fPackRowLength(0)
, fUnPackRowLength(0)
, fCurTextureUnit(0)
- , fArrayBuffer(NULL)
- , fElementArrayBuffer(NULL)
- , fFrameBuffer(NULL)
- , fRenderBuffer(NULL)
- , fProgram(NULL)
- , fTexture(NULL)
- , fVertexArray(NULL)
+ , fArrayBuffer(nullptr)
+ , fElementArrayBuffer(nullptr)
+ , fFrameBuffer(nullptr)
+ , fRenderBuffer(nullptr)
+ , fProgram(nullptr)
+ , fTexture(nullptr)
+ , fVertexArray(nullptr)
, fAbandoned(false) {
for (int i = 0; i < kDefaultMaxTextureUnits; ++i) {
@@ -67,13 +67,13 @@ GrDebugGL::~GrDebugGL() {
}
fObjects.reset();
- fArrayBuffer = NULL;
- fElementArrayBuffer = NULL;
- fFrameBuffer = NULL;
- fRenderBuffer = NULL;
- fProgram = NULL;
- fTexture = NULL;
- fVertexArray = NULL;
+ fArrayBuffer = nullptr;
+ fElementArrayBuffer = nullptr;
+ fFrameBuffer = nullptr;
+ fRenderBuffer = nullptr;
+ fProgram = nullptr;
+ fTexture = nullptr;
+ fVertexArray = nullptr;
}
GrFakeRefObj *GrDebugGL::findObject(GrGLuint ID, GrObjTypes type) {
@@ -87,7 +87,7 @@ GrFakeRefObj *GrDebugGL::findObject(GrGLuint ID, GrObjTypes type) {
}
}
- return NULL;
+ return nullptr;
}
void GrDebugGL::setArrayBuffer(GrBufferObj *arrayBuffer) {
diff --git a/src/gpu/gl/debug/GrDebugGL.h b/src/gpu/gl/debug/GrDebugGL.h
index ae6a978363..2560879b4f 100644
--- a/src/gpu/gl/debug/GrDebugGL.h
+++ b/src/gpu/gl/debug/GrDebugGL.h
@@ -92,7 +92,7 @@ public:
// someone should admit to actually using this class
SkASSERT(0 < gStaticRefCount);
- if (NULL == gObj) {
+ if (nullptr == gObj) {
gObj = new GrDebugGL;
}
@@ -110,7 +110,7 @@ public:
gStaticRefCount--;
if (0 == gStaticRefCount) {
delete gObj;
- gObj = NULL;
+ gObj = nullptr;
}
}
diff --git a/src/gpu/gl/debug/GrFrameBufferObj.h b/src/gpu/gl/debug/GrFrameBufferObj.h
index 794450c136..42a0effe07 100644
--- a/src/gpu/gl/debug/GrFrameBufferObj.h
+++ b/src/gpu/gl/debug/GrFrameBufferObj.h
@@ -22,15 +22,15 @@ public:
GrFrameBufferObj()
: GrFakeRefObj()
, fBound(false)
- , fColorBuffer(NULL)
- , fDepthBuffer(NULL)
- , fStencilBuffer(NULL) {
+ , fColorBuffer(nullptr)
+ , fDepthBuffer(nullptr)
+ , fStencilBuffer(nullptr) {
}
virtual ~GrFrameBufferObj() {
- fColorBuffer = NULL;
- fDepthBuffer = NULL;
- fStencilBuffer = NULL;
+ fColorBuffer = nullptr;
+ fDepthBuffer = nullptr;
+ fStencilBuffer = nullptr;
}
void setBound() { fBound = true; }
@@ -48,9 +48,9 @@ public:
void deleteAction() override {
- setColor(NULL);
- setDepth(NULL);
- setStencil(NULL);
+ setColor(nullptr);
+ setDepth(nullptr);
+ setStencil(nullptr);
this->INHERITED::deleteAction();
}
diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
index ef52fb6763..75b673688d 100644
--- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
+++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
@@ -84,7 +84,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLBufferData(GrGLenum target,
GR_GL_STATIC_DRAW == usage ||
GR_GL_DYNAMIC_DRAW == usage);
- GrBufferObj *buffer = NULL;
+ GrBufferObj *buffer = nullptr;
switch (target) {
case GR_GL_ARRAY_BUFFER:
buffer = GrDebugGL::getInstance()->getArrayBuffer();
@@ -241,7 +241,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLReadPixels(GrGLint x,
if (textures[j] == pTU->getTexture()->getID()) {
// this ID is the current texture - revert the binding to 0
- pTU->setTexture(NULL);
+ pTU->setTexture(nullptr);
}
}
}
@@ -258,15 +258,15 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLReadPixels(GrGLint x,
if (frameBuffer->getColor() &&
textures[i] == frameBuffer->getColor()->getID()) {
- frameBuffer->setColor(NULL);
+ frameBuffer->setColor(nullptr);
}
if (frameBuffer->getDepth() &&
textures[i] == frameBuffer->getDepth()->getID()) {
- frameBuffer->setDepth(NULL);
+ frameBuffer->setDepth(nullptr);
}
if (frameBuffer->getStencil() &&
textures[i] == frameBuffer->getStencil()->getID()) {
- frameBuffer->setStencil(NULL);
+ frameBuffer->setStencil(nullptr);
}
}
}
@@ -298,7 +298,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLReadPixels(GrGLint x,
if (frameBuffers[i] ==
GrDebugGL::getInstance()->getFrameBuffer()->getID()) {
// this ID is the current frame buffer - rebind to the default
- GrDebugGL::getInstance()->setFrameBuffer(NULL);
+ GrDebugGL::getInstance()->setFrameBuffer(nullptr);
}
}
}
@@ -326,7 +326,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLReadPixels(GrGLint x,
GrDebugGL::getInstance()->getRenderBuffer()->getID()) {
// this ID is the current render buffer - make no
// render buffer be bound
- GrDebugGL::getInstance()->setRenderBuffer(NULL);
+ GrDebugGL::getInstance()->setRenderBuffer(nullptr);
}
}
}
@@ -343,15 +343,15 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLReadPixels(GrGLint x,
if (frameBuffer->getColor() &&
renderBuffers[i] == frameBuffer->getColor()->getID()) {
- frameBuffer->setColor(NULL);
+ frameBuffer->setColor(nullptr);
}
if (frameBuffer->getDepth() &&
renderBuffers[i] == frameBuffer->getDepth()->getID()) {
- frameBuffer->setDepth(NULL);
+ frameBuffer->setDepth(nullptr);
}
if (frameBuffer->getStencil() &&
renderBuffers[i] == frameBuffer->getStencil()->getID()) {
- frameBuffer->setStencil(NULL);
+ frameBuffer->setStencil(nullptr);
}
}
}
@@ -552,7 +552,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteVertexArrays(GrGLsizei n, const GrGLui
// Deleting the current vertex array binds object 0
if (GrDebugGL::getInstance()->getVertexArray() == array) {
- GrDebugGL::getInstance()->setVertexArray(NULL);
+ GrDebugGL::getInstance()->setVertexArray(nullptr);
}
if (array->getRefCount()) {
@@ -599,13 +599,13 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteBuffers(GrGLsizei n, const GrGLuint* i
if (GrDebugGL::getInstance()->getArrayBuffer() &&
ids[i] == GrDebugGL::getInstance()->getArrayBuffer()->getID()) {
// this ID is the current array buffer
- GrDebugGL::getInstance()->setArrayBuffer(NULL);
+ GrDebugGL::getInstance()->setArrayBuffer(nullptr);
}
if (GrDebugGL::getInstance()->getElementArrayBuffer() &&
ids[i] ==
GrDebugGL::getInstance()->getElementArrayBuffer()->getID()) {
// this ID is the current element array buffer
- GrDebugGL::getInstance()->setElementArrayBuffer(NULL);
+ GrDebugGL::getInstance()->setElementArrayBuffer(nullptr);
}
}
@@ -631,7 +631,7 @@ GrGLvoid* GR_GL_FUNCTION_TYPE debugGLMapBufferRange(GrGLenum target, GrGLintptr
GrAlwaysAssert(!SkToBool(GR_GL_MAP_READ_BIT & access));
GrAlwaysAssert((GR_GL_MAP_INVALIDATE_BUFFER_BIT | GR_GL_MAP_INVALIDATE_RANGE_BIT) & access);
- GrBufferObj *buffer = NULL;
+ GrBufferObj *buffer = nullptr;
switch (target) {
case GR_GL_ARRAY_BUFFER:
buffer = GrDebugGL::getInstance()->getArrayBuffer();
@@ -652,13 +652,13 @@ GrGLvoid* GR_GL_FUNCTION_TYPE debugGLMapBufferRange(GrGLenum target, GrGLintptr
}
GrAlwaysAssert(false);
- return NULL; // no buffer bound to the target
+ return nullptr; // no buffer bound to the target
}
GrGLvoid* GR_GL_FUNCTION_TYPE debugGLMapBuffer(GrGLenum target, GrGLenum access) {
GrAlwaysAssert(GR_GL_WRITE_ONLY == access);
- GrBufferObj *buffer = NULL;
+ GrBufferObj *buffer = nullptr;
switch (target) {
case GR_GL_ARRAY_BUFFER:
buffer = GrDebugGL::getInstance()->getArrayBuffer();
@@ -682,7 +682,7 @@ GrGLboolean GR_GL_FUNCTION_TYPE debugGLUnmapBuffer(GrGLenum target) {
GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target ||
GR_GL_ELEMENT_ARRAY_BUFFER == target);
- GrBufferObj *buffer = NULL;
+ GrBufferObj *buffer = nullptr;
switch (target) {
case GR_GL_ARRAY_BUFFER:
buffer = GrDebugGL::getInstance()->getArrayBuffer();
@@ -711,7 +711,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLFlushMappedBufferRange(GrGLenum target,
GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target ||
GR_GL_ELEMENT_ARRAY_BUFFER == target);
- GrBufferObj *buffer = NULL;
+ GrBufferObj *buffer = nullptr;
switch (target) {
case GR_GL_ARRAY_BUFFER:
buffer = GrDebugGL::getInstance()->getArrayBuffer();
@@ -742,7 +742,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetBufferParameteriv(GrGLenum target,
GrAlwaysAssert(GR_GL_BUFFER_SIZE == value ||
GR_GL_BUFFER_USAGE == value);
- GrBufferObj *buffer = NULL;
+ GrBufferObj *buffer = nullptr;
switch (target) {
case GR_GL_ARRAY_BUFFER:
buffer = GrDebugGL::getInstance()->getArrayBuffer();
@@ -784,7 +784,7 @@ public:
GrDebugGLInterface()
- : fWrapped(NULL) {
+ : fWrapped(nullptr) {
GrDebugGL::staticRef();
}
diff --git a/src/gpu/gl/debug/GrTextureUnitObj.h b/src/gpu/gl/debug/GrTextureUnitObj.h
index 7d9ed2e6df..b0254a0fc1 100644
--- a/src/gpu/gl/debug/GrTextureUnitObj.h
+++ b/src/gpu/gl/debug/GrTextureUnitObj.h
@@ -22,7 +22,7 @@ public:
GrTextureUnitObj()
: GrFakeRefObj()
, fNumber(0)
- , fTexture(NULL) {
+ , fTexture(nullptr) {
}
void setNumber(GrGLenum number) {
diff --git a/src/gpu/gl/debug/SkDebugGLContext.h b/src/gpu/gl/debug/SkDebugGLContext.h
index 0a61f72cb2..abbcf559c5 100644
--- a/src/gpu/gl/debug/SkDebugGLContext.h
+++ b/src/gpu/gl/debug/SkDebugGLContext.h
@@ -16,14 +16,14 @@ public:
static SkDebugGLContext* Create(GrGLStandard forcedGpuAPI) {
if (kGLES_GrGLStandard == forcedGpuAPI) {
- return NULL;
+ return nullptr;
}
return new SkDebugGLContext;
}
private:
void onPlatformMakeCurrent() const override {}
void onPlatformSwapBuffers() const override {}
- GrGLFuncPtr onPlatformGetProcAddress(const char*) const override { return NULL; }
+ GrGLFuncPtr onPlatformGetProcAddress(const char*) const override { return nullptr; }
SkDebugGLContext();
};
diff --git a/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp b/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp
index ddc9e693a4..703e39d097 100644
--- a/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp
+++ b/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp
@@ -13,10 +13,10 @@
#include <GLES2/gl2.h>
static GrGLFuncPtr egl_get_gl_proc(void* ctx, const char name[]) {
- SkASSERT(NULL == ctx);
+ SkASSERT(nullptr == ctx);
return eglGetProcAddress(name);
}
const GrGLInterface* GrGLCreateNativeInterface() {
- return GrGLAssembleInterface(NULL, egl_get_gl_proc);
+ return GrGLAssembleInterface(nullptr, egl_get_gl_proc);
}
diff --git a/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp b/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp
index 9bdedf7ef0..d1335d355f 100644
--- a/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp
+++ b/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp
@@ -93,7 +93,7 @@ EGLGLContext::EGLGLContext(GrGLStandard forcedGpuAPI)
SkAutoTUnref<const GrGLInterface> gl;
- for (; NULL == gl.get() && api < apiLimit; ++api) {
+ for (; nullptr == gl.get() && api < apiLimit; ++api) {
fDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
EGLint majorVersion;
@@ -133,7 +133,7 @@ EGLGLContext::EGLGLContext(GrGLStandard forcedGpuAPI)
continue;
}
- fContext = eglCreateContext(fDisplay, surfaceConfig, NULL, kAPIs[api].fContextAttribs);
+ fContext = eglCreateContext(fDisplay, surfaceConfig, nullptr, kAPIs[api].fContextAttribs);
if (EGL_NO_CONTEXT == fContext) {
SkDebugf("eglCreateContext failed. EGL Error: 0x%08x\n", eglGetError());
continue;
@@ -159,7 +159,7 @@ EGLGLContext::EGLGLContext(GrGLStandard forcedGpuAPI)
}
gl.reset(GrGLCreateNativeInterface());
- if (NULL == gl.get()) {
+ if (nullptr == gl.get()) {
SkDebugf("Failed to create gl interface.\n");
this->destroyGLContext();
continue;
@@ -234,13 +234,13 @@ static bool supports_egl_extension(EGLDisplay display, const char* extension) {
SkEGLFenceSync* SkEGLFenceSync::CreateIfSupported(EGLDisplay display) {
if (!display || !supports_egl_extension(display, "EGL_KHR_fence_sync")) {
- return NULL;
+ return nullptr;
}
return new SkEGLFenceSync(display);
}
SkPlatformGpuFence SkEGLFenceSync::insertFence() const {
- return eglCreateSyncKHR(fDisplay, EGL_SYNC_FENCE_KHR, NULL);
+ return eglCreateSyncKHR(fDisplay, EGL_SYNC_FENCE_KHR, nullptr);
}
bool SkEGLFenceSync::flushAndWaitFence(SkPlatformGpuFence platformFence) const {
@@ -262,7 +262,7 @@ SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) {
EGLGLContext* ctx = new EGLGLContext(forcedGpuAPI);
if (!ctx->isValid()) {
delete ctx;
- return NULL;
+ return nullptr;
}
return ctx;
}
diff --git a/src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp b/src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp
index 19eec7e8ac..e3d37bd80f 100644
--- a/src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp
+++ b/src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp
@@ -13,15 +13,15 @@
#include <GL/glx.h>
static GrGLFuncPtr glx_get(void* ctx, const char name[]) {
- SkASSERT(NULL == ctx);
+ SkASSERT(nullptr == ctx);
SkASSERT(glXGetCurrentContext());
return glXGetProcAddress(reinterpret_cast<const GLubyte*>(name));
}
const GrGLInterface* GrGLCreateNativeInterface() {
- if (NULL == glXGetCurrentContext()) {
- return NULL;
+ if (nullptr == glXGetCurrentContext()) {
+ return nullptr;
}
- return GrGLAssembleInterface(NULL, glx_get);
+ return GrGLAssembleInterface(nullptr, glx_get);
}
diff --git a/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp b/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp
index cabd4431eb..8c58a53702 100644
--- a/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp
+++ b/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp
@@ -63,8 +63,8 @@ private:
};
GLXGLContext::GLXGLContext(GrGLStandard forcedGpuAPI)
- : fContext(NULL)
- , fDisplay(NULL)
+ : fContext(nullptr)
+ , fDisplay(nullptr)
, fPixmap(0)
, fGlxPixmap(0) {
@@ -270,7 +270,7 @@ GLXGLContext::GLXGLContext(GrGLStandard forcedGpuAPI)
}
SkAutoTUnref<const GrGLInterface> gl(GrGLCreateNativeInterface());
- if (NULL == gl.get()) {
+ if (nullptr == gl.get()) {
SkDebugf("Failed to create gl interface");
this->destroyGLContext();
return;
@@ -297,7 +297,7 @@ void GLXGLContext::destroyGLContext() {
if (fContext) {
glXDestroyContext(fDisplay, fContext);
- fContext = NULL;
+ fContext = nullptr;
}
if (fGlxPixmap) {
@@ -311,7 +311,7 @@ void GLXGLContext::destroyGLContext() {
}
XCloseDisplay(fDisplay);
- fDisplay = NULL;
+ fDisplay = nullptr;
}
}
@@ -335,7 +335,7 @@ SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) {
GLXGLContext *ctx = new GLXGLContext(forcedGpuAPI);
if (!ctx->isValid()) {
delete ctx;
- return NULL;
+ return nullptr;
}
return ctx;
}
diff --git a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp
index ccbc50f5ee..c85f05c07e 100644
--- a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp
+++ b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp
@@ -25,7 +25,7 @@ public:
}
void* handle() const {
- return NULL == fLibrary ? RTLD_DEFAULT : fLibrary;
+ return nullptr == fLibrary ? RTLD_DEFAULT : fLibrary;
}
private:
diff --git a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
index a0c50c7409..9a2abfe066 100644
--- a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
+++ b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
@@ -27,7 +27,7 @@ public:
}
void* handle() const {
- return NULL == fLibrary ? RTLD_DEFAULT : fLibrary;
+ return nullptr == fLibrary ? RTLD_DEFAULT : fLibrary;
}
private:
diff --git a/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp b/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp
index 4754c01557..fa4126a62c 100644
--- a/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp
+++ b/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp
@@ -29,7 +29,7 @@ private:
};
MacGLContext::MacGLContext()
- : fContext(NULL)
+ : fContext(nullptr)
, fGLLibrary(RTLD_DEFAULT) {
CGLPixelFormatAttribute attributes[] = {
#if MAC_OS_X_VERSION_10_7
@@ -43,15 +43,15 @@ MacGLContext::MacGLContext()
CGLChoosePixelFormat(attributes, &pixFormat, &npix);
- if (NULL == pixFormat) {
+ if (nullptr == pixFormat) {
SkDebugf("CGLChoosePixelFormat failed.");
return;
}
- CGLCreateContext(pixFormat, NULL, &fContext);
+ CGLCreateContext(pixFormat, nullptr, &fContext);
CGLReleasePixelFormat(pixFormat);
- if (NULL == fContext) {
+ if (nullptr == fContext) {
SkDebugf("CGLCreateContext failed.");
return;
}
@@ -59,7 +59,7 @@ MacGLContext::MacGLContext()
CGLSetCurrentContext(fContext);
SkAutoTUnref<const GrGLInterface> gl(GrGLCreateNativeInterface());
- if (NULL == gl.get()) {
+ if (nullptr == gl.get()) {
SkDebugf("Context could not create GL interface.\n");
this->destroyGLContext();
return;
@@ -85,7 +85,7 @@ MacGLContext::~MacGLContext() {
void MacGLContext::destroyGLContext() {
if (fContext) {
CGLReleaseContext(fContext);
- fContext = NULL;
+ fContext = nullptr;
}
if (RTLD_DEFAULT != fGLLibrary) {
dlclose(fGLLibrary);
@@ -108,12 +108,12 @@ GrGLFuncPtr MacGLContext::onPlatformGetProcAddress(const char* procName) const {
SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) {
if (kGLES_GrGLStandard == forcedGpuAPI) {
- return NULL;
+ return nullptr;
}
MacGLContext* ctx = new MacGLContext;
if (!ctx->isValid()) {
delete ctx;
- return NULL;
+ return nullptr;
}
return ctx;
}
diff --git a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
index ab48718f6d..734c1fea0c 100644
--- a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
+++ b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
@@ -12,14 +12,14 @@
#include "osmesa_wrapper.h"
static GrGLFuncPtr osmesa_get(void* ctx, const char name[]) {
- SkASSERT(NULL == ctx);
+ SkASSERT(nullptr == ctx);
SkASSERT(OSMesaGetCurrentContext());
return OSMesaGetProcAddress(name);
}
const GrGLInterface* GrGLCreateMesaInterface() {
- if (NULL == OSMesaGetCurrentContext()) {
- return NULL;
+ if (nullptr == OSMesaGetCurrentContext()) {
+ return nullptr;
}
- return GrGLAssembleInterface(NULL, osmesa_get);
+ return GrGLAssembleInterface(nullptr, osmesa_get);
}
diff --git a/src/gpu/gl/mesa/SkMesaGLContext.cpp b/src/gpu/gl/mesa/SkMesaGLContext.cpp
index 701cc0d320..730206e560 100644
--- a/src/gpu/gl/mesa/SkMesaGLContext.cpp
+++ b/src/gpu/gl/mesa/SkMesaGLContext.cpp
@@ -14,16 +14,16 @@
static const GrGLint gBOGUS_SIZE = 16;
SkMesaGLContext::SkMesaGLContext()
- : fContext(static_cast<Context>(NULL))
- , fImage(NULL) {
+ : fContext(static_cast<Context>(nullptr))
+ , fImage(nullptr) {
GR_STATIC_ASSERT(sizeof(Context) == sizeof(OSMesaContext));
/* Create an RGBA-mode context */
#if OSMESA_MAJOR_VERSION * 100 + OSMESA_MINOR_VERSION >= 305
/* specify Z, stencil, accum sizes */
- fContext = (Context)OSMesaCreateContextExt(OSMESA_BGRA, 0, 0, 0, NULL);
+ fContext = (Context)OSMesaCreateContextExt(OSMESA_BGRA, 0, 0, 0, nullptr);
#else
- fContext = (Context)OSMesaCreateContext(OSMESA_BGRA, NULL);
+ fContext = (Context)OSMesaCreateContext(OSMESA_BGRA, nullptr);
#endif
if (!fContext) {
SkDebugf("OSMesaCreateContext failed!\n");
@@ -51,7 +51,7 @@ SkMesaGLContext::SkMesaGLContext()
}
SkAutoTUnref<const GrGLInterface> gl(GrGLCreateMesaInterface());
- if (NULL == gl.get()) {
+ if (nullptr == gl.get()) {
SkDebugf("Could not create GL interface!\n");
this->destroyGLContext();
return;
@@ -74,12 +74,12 @@ SkMesaGLContext::~SkMesaGLContext() {
void SkMesaGLContext::destroyGLContext() {
if (fImage) {
sk_free(fImage);
- fImage = NULL;
+ fImage = nullptr;
}
if (fContext) {
OSMesaDestroyContext((OSMesaContext)fContext);
- fContext = static_cast<Context>(NULL);
+ fContext = static_cast<Context>(nullptr);
}
}
diff --git a/src/gpu/gl/mesa/SkMesaGLContext.h b/src/gpu/gl/mesa/SkMesaGLContext.h
index 1548bfd8ee..a58f1c890e 100644
--- a/src/gpu/gl/mesa/SkMesaGLContext.h
+++ b/src/gpu/gl/mesa/SkMesaGLContext.h
@@ -21,12 +21,12 @@ public:
static SkMesaGLContext* Create(GrGLStandard forcedGpuAPI) {
if (kGLES_GrGLStandard == forcedGpuAPI) {
- return NULL;
+ return nullptr;
}
SkMesaGLContext* ctx = new SkMesaGLContext;
if (!ctx->isValid()) {
delete ctx;
- return NULL;
+ return nullptr;
}
return ctx;
}
diff --git a/src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp b/src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp
index 5cb4423897..21f30019a9 100644
--- a/src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp
+++ b/src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp
@@ -8,7 +8,7 @@
#include "gl/SkGLContext.h"
SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) {
- return NULL;
+ return nullptr;
}
diff --git a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
index cba380b74d..c2fcca5469 100644
--- a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
+++ b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
@@ -42,7 +42,7 @@ public:
if ((proc = (GrGLFuncPtr) wglGetProcAddress(name))) {
return proc;
}
- return NULL;
+ return nullptr;
}
private:
@@ -62,18 +62,18 @@ static GrGLFuncPtr win_get_gl_proc(void* ctx, const char name[]) {
* Otherwise, a springboard would be needed that hides the calling convention.
*/
const GrGLInterface* GrGLCreateNativeInterface() {
- if (NULL == wglGetCurrentContext()) {
- return NULL;
+ if (nullptr == wglGetCurrentContext()) {
+ return nullptr;
}
GLProcGetter getter;
if (!getter.isInitialized()) {
- return NULL;
+ return nullptr;
}
GrGLGetStringProc getString = (GrGLGetStringProc)getter.getProc("glGetString");
- if (NULL == getString) {
- return NULL;
+ if (nullptr == getString) {
+ return nullptr;
}
const char* verStr = reinterpret_cast<const char*>(getString(GR_GL_VERSION));
GrGLStandard standard = GrGLGetStandardInUseFromString(verStr);
@@ -83,5 +83,5 @@ const GrGLInterface* GrGLCreateNativeInterface() {
} else if (kGL_GrGLStandard == standard) {
return GrGLAssembleGLInterface(&getter, win_get_gl_proc);
}
- return NULL;
+ return nullptr;
}
diff --git a/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp b/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp
index 0517f73ee4..f795f52554 100644
--- a/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp
+++ b/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp
@@ -39,23 +39,23 @@ private:
ATOM WinGLContext::gWC = 0;
WinGLContext::WinGLContext(GrGLStandard forcedGpuAPI)
- : fWindow(NULL)
- , fDeviceContext(NULL)
+ : fWindow(nullptr)
+ , fDeviceContext(nullptr)
, fGlRenderContext(0)
- , fPbufferContext(NULL) {
- HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL);
+ , fPbufferContext(nullptr) {
+ HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(nullptr);
if (!gWC) {
WNDCLASS wc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
- wc.hbrBackground = NULL;
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
+ wc.hbrBackground = nullptr;
+ wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
+ wc.hIcon = LoadIcon(nullptr, IDI_APPLICATION);
wc.hInstance = hInstance;
wc.lpfnWndProc = (WNDPROC) DefWindowProc;
wc.lpszClassName = TEXT("Griffin");
- wc.lpszMenuName = NULL;
+ wc.lpszMenuName = nullptr;
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
gWC = RegisterClass(&wc);
@@ -69,8 +69,8 @@ WinGLContext::WinGLContext(GrGLStandard forcedGpuAPI)
TEXT("The Invisible Man"),
WS_OVERLAPPEDWINDOW,
0, 0, 1, 1,
- NULL, NULL,
- hInstance, NULL))) {
+ nullptr, nullptr,
+ hInstance, nullptr))) {
SkDebugf("Could not create window.\n");
return;
}
@@ -91,7 +91,7 @@ WinGLContext::WinGLContext(GrGLStandard forcedGpuAPI)
HDC dc;
HGLRC glrc;
- if (NULL == fPbufferContext) {
+ if (nullptr == fPbufferContext) {
if (!(fGlRenderContext = SkCreateWGLContext(fDeviceContext, 0, contextType))) {
SkDebugf("Could not create rendering context.\n");
this->destroyGLContext();
@@ -116,7 +116,7 @@ WinGLContext::WinGLContext(GrGLStandard forcedGpuAPI)
}
SkAutoTUnref<const GrGLInterface> gl(GrGLCreateNativeInterface());
- if (NULL == gl.get()) {
+ if (nullptr == gl.get()) {
SkDebugf("Could not create GL interface.\n");
this->destroyGLContext();
return;
@@ -155,7 +155,7 @@ void WinGLContext::onPlatformMakeCurrent() const {
HDC dc;
HGLRC glrc;
- if (NULL == fPbufferContext) {
+ if (nullptr == fPbufferContext) {
dc = fDeviceContext;
glrc = fGlRenderContext;
} else {
@@ -171,7 +171,7 @@ void WinGLContext::onPlatformMakeCurrent() const {
void WinGLContext::onPlatformSwapBuffers() const {
HDC dc;
- if (NULL == fPbufferContext) {
+ if (nullptr == fPbufferContext) {
dc = fDeviceContext;
} else {
dc = fPbufferContext->getDC();
@@ -191,7 +191,7 @@ SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) {
WinGLContext* ctx = new WinGLContext(forcedGpuAPI);
if (!ctx->isValid()) {
delete ctx;
- return NULL;
+ return nullptr;
}
return ctx;
}