diff options
Diffstat (limited to 'src/gpu/gl/debug')
-rw-r--r-- | src/gpu/gl/debug/GrBufferObj.h | 6 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrDebugGL.cpp | 22 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrDebugGL.h | 4 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrFBBindableObj.h | 26 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrFakeRefObj.h | 18 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrGLCreateDebugInterface.cpp | 596 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrShaderObj.h | 2 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrTextureObj.h | 12 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrTextureUnitObj.cpp | 4 |
9 files changed, 345 insertions, 345 deletions
diff --git a/src/gpu/gl/debug/GrBufferObj.h b/src/gpu/gl/debug/GrBufferObj.h index a78da837d2..faa23985c5 100644 --- a/src/gpu/gl/debug/GrBufferObj.h +++ b/src/gpu/gl/debug/GrBufferObj.h @@ -17,7 +17,7 @@ class GrBufferObj : public GrFakeRefObj { GR_DEFINE_CREATOR(GrBufferObj); public: - GrBufferObj() + GrBufferObj() : GrFakeRefObj() , fDataPtr(NULL) , fMapped(false) @@ -58,8 +58,8 @@ private: bool fMapped; // is the buffer object mapped via "glMapBuffer"? bool fBound; // is the buffer object bound via "glBindBuffer"? GrGLint fSize; // size in bytes - GrGLint fUsage; // one of: GL_STREAM_DRAW, - // GL_STATIC_DRAW, + GrGLint fUsage; // one of: GL_STREAM_DRAW, + // GL_STATIC_DRAW, // GL_DYNAMIC_DRAW typedef GrFakeRefObj INHERITED; diff --git a/src/gpu/gl/debug/GrDebugGL.cpp b/src/gpu/gl/debug/GrDebugGL.cpp index 657003967f..9e2e510b1b 100644 --- a/src/gpu/gl/debug/GrDebugGL.cpp +++ b/src/gpu/gl/debug/GrDebugGL.cpp @@ -29,7 +29,7 @@ GrDebugGL::Create GrDebugGL::gFactoryFunc[kObjTypeCount] = { }; -GrDebugGL::GrDebugGL() +GrDebugGL::GrDebugGL() : fPackRowLength(0) , fUnPackRowLength(0) , fCurTextureUnit(0) @@ -76,7 +76,7 @@ GrFakeRefObj *GrDebugGL::findObject(GrGLuint ID, GrObjTypes type) { for (int i = 0; i < fObjects.count(); ++i) { if (fObjects[i]->getID() == ID) { // && fObjects[i]->getType() == type) { // The application shouldn't be accessing objects - // that (as far as OpenGL knows) were already deleted + // that (as far as OpenGL knows) were already deleted GrAlwaysAssert(!fObjects[i]->getDeleted()); GrAlwaysAssert(!fObjects[i]->getMarkedForDeletion()); return fObjects[i]; @@ -86,7 +86,7 @@ GrFakeRefObj *GrDebugGL::findObject(GrGLuint ID, GrObjTypes type) { return NULL; } -void GrDebugGL::setArrayBuffer(GrBufferObj *arrayBuffer) { +void GrDebugGL::setArrayBuffer(GrBufferObj *arrayBuffer) { if (fArrayBuffer) { // automatically break the binding of the old buffer GrAlwaysAssert(fArrayBuffer->getBound()); @@ -96,7 +96,7 @@ void GrDebugGL::setArrayBuffer(GrBufferObj *arrayBuffer) { fArrayBuffer->unref(); } - fArrayBuffer = arrayBuffer; + fArrayBuffer = arrayBuffer; if (fArrayBuffer) { GrAlwaysAssert(!fArrayBuffer->getDeleted()); @@ -107,7 +107,7 @@ void GrDebugGL::setArrayBuffer(GrBufferObj *arrayBuffer) { } } -void GrDebugGL::setElementArrayBuffer(GrBufferObj *elementArrayBuffer) { +void GrDebugGL::setElementArrayBuffer(GrBufferObj *elementArrayBuffer) { if (fElementArrayBuffer) { // automatically break the binding of the old buffer GrAlwaysAssert(fElementArrayBuffer->getBound()); @@ -117,7 +117,7 @@ void GrDebugGL::setElementArrayBuffer(GrBufferObj *elementArrayBuffer) { fElementArrayBuffer->unref(); } - fElementArrayBuffer = elementArrayBuffer; + fElementArrayBuffer = elementArrayBuffer; if (fElementArrayBuffer) { GrAlwaysAssert(!fElementArrayBuffer->getDeleted()); @@ -128,11 +128,11 @@ void GrDebugGL::setElementArrayBuffer(GrBufferObj *elementArrayBuffer) { } } -void GrDebugGL::setTexture(GrTextureObj *texture) { +void GrDebugGL::setTexture(GrTextureObj *texture) { fTextureUnits[fCurTextureUnit]->setTexture(texture); } -void GrDebugGL::setFrameBuffer(GrFrameBufferObj *frameBuffer) { +void GrDebugGL::setFrameBuffer(GrFrameBufferObj *frameBuffer) { if (fFrameBuffer) { GrAlwaysAssert(fFrameBuffer->getBound()); fFrameBuffer->resetBound(); @@ -141,7 +141,7 @@ void GrDebugGL::setFrameBuffer(GrFrameBufferObj *frameBuffer) { fFrameBuffer->unref(); } - fFrameBuffer = frameBuffer; + fFrameBuffer = frameBuffer; if (fFrameBuffer) { GrAlwaysAssert(!fFrameBuffer->getDeleted()); @@ -152,7 +152,7 @@ void GrDebugGL::setFrameBuffer(GrFrameBufferObj *frameBuffer) { } } -void GrDebugGL::setRenderBuffer(GrRenderBufferObj *renderBuffer) { +void GrDebugGL::setRenderBuffer(GrRenderBufferObj *renderBuffer) { if (fRenderBuffer) { GrAlwaysAssert(fRenderBuffer->getBound()); fRenderBuffer->resetBound(); @@ -161,7 +161,7 @@ void GrDebugGL::setRenderBuffer(GrRenderBufferObj *renderBuffer) { fRenderBuffer->unref(); } - fRenderBuffer = renderBuffer; + fRenderBuffer = renderBuffer; if (fRenderBuffer) { GrAlwaysAssert(!fRenderBuffer->getDeleted()); diff --git a/src/gpu/gl/debug/GrDebugGL.h b/src/gpu/gl/debug/GrDebugGL.h index d6697fd211..409f13d106 100644 --- a/src/gpu/gl/debug/GrDebugGL.h +++ b/src/gpu/gl/debug/GrDebugGL.h @@ -73,8 +73,8 @@ public: void useProgram(GrProgramObj *program); - void setPackRowLength(GrGLint packRowLength) { - fPackRowLength = packRowLength; + void setPackRowLength(GrGLint packRowLength) { + fPackRowLength = packRowLength; } GrGLint getPackRowLength() const { return fPackRowLength; } diff --git a/src/gpu/gl/debug/GrFBBindableObj.h b/src/gpu/gl/debug/GrFBBindableObj.h index 38c86380a2..e2b43a6a1b 100644 --- a/src/gpu/gl/debug/GrFBBindableObj.h +++ b/src/gpu/gl/debug/GrFBBindableObj.h @@ -17,7 +17,7 @@ class GrFBBindableObj : public GrFakeRefObj { public: - GrFBBindableObj() + GrFBBindableObj() : GrFakeRefObj() { } @@ -27,51 +27,51 @@ public: GrAlwaysAssert(0 == fStencilReferees.count()); } - void setColorBound(GrFakeRefObj *referee) { + void setColorBound(GrFakeRefObj *referee) { fColorReferees.append(1, &referee); } - void resetColorBound(GrFakeRefObj *referee) { + void resetColorBound(GrFakeRefObj *referee) { int index = fColorReferees.find(referee); GrAlwaysAssert(0 <= index); fColorReferees.removeShuffle(index); } - bool getColorBound(GrFakeRefObj *referee) const { + bool getColorBound(GrFakeRefObj *referee) const { int index = fColorReferees.find(referee); return 0 <= index; } - bool getColorBound() const { + bool getColorBound() const { return 0 != fColorReferees.count(); } - void setDepthBound(GrFakeRefObj *referee) { + void setDepthBound(GrFakeRefObj *referee) { fDepthReferees.append(1, &referee); } - void resetDepthBound(GrFakeRefObj *referee) { + void resetDepthBound(GrFakeRefObj *referee) { int index = fDepthReferees.find(referee); GrAlwaysAssert(0 <= index); fDepthReferees.removeShuffle(index); } - bool getDepthBound(GrFakeRefObj *referee) const { + bool getDepthBound(GrFakeRefObj *referee) const { int index = fDepthReferees.find(referee); return 0 <= index; } - bool getDepthBound() const { + bool getDepthBound() const { return 0 != fDepthReferees.count(); } - void setStencilBound(GrFakeRefObj *referee) { + void setStencilBound(GrFakeRefObj *referee) { fStencilReferees.append(1, &referee); } - void resetStencilBound(GrFakeRefObj *referee) { + void resetStencilBound(GrFakeRefObj *referee) { int index = fStencilReferees.find(referee); GrAlwaysAssert(0 <= index); fStencilReferees.removeShuffle(index); } - bool getStencilBound(GrFakeRefObj *referee) const { + bool getStencilBound(GrFakeRefObj *referee) const { int index = fStencilReferees.find(referee); return 0 <= index; } - bool getStencilBound() const { + bool getStencilBound() const { return 0 != fStencilReferees.count(); } diff --git a/src/gpu/gl/debug/GrFakeRefObj.h b/src/gpu/gl/debug/GrFakeRefObj.h index 81fb90c4d0..7f21c94181 100644 --- a/src/gpu/gl/debug/GrFakeRefObj.h +++ b/src/gpu/gl/debug/GrFakeRefObj.h @@ -14,41 +14,41 @@ //////////////////////////////////////////////////////////////////////////////// // This object is used to track the OpenGL objects. We don't use real -// reference counting (i.e., we don't free the objects when their ref count +// reference counting (i.e., we don't free the objects when their ref count // goes to 0) so that we can detect invalid memory accesses. The refs we // are tracking in this class are actually OpenGL's references to the objects // not "ours" // Each object also gets a unique globally identifying ID class GrFakeRefObj : public GrNoncopyable { public: - GrFakeRefObj() + GrFakeRefObj() : fRef(0) , fHighRefCount(0) , fMarkedForDeletion(false) , fDeleted(false) { // source for globally unique IDs - 0 is reserved! - static int fNextID = 0; + static int fNextID = 0; fID = ++fNextID; } virtual ~GrFakeRefObj() {}; - void ref() { - fRef++; + void ref() { + fRef++; if (fHighRefCount < fRef) { fHighRefCount = fRef; } } - void unref() { - fRef--; + void unref() { + fRef--; GrAlwaysAssert(fRef >= 0); - // often in OpenGL a given object may still be in use when the + // often in OpenGL a given object may still be in use when the // delete call is made. In these cases the object is marked // for deletion and then freed when it is no longer in use if (0 == fRef && fMarkedForDeletion) { - this->deleteAction(); + this->deleteAction(); } } int getRefCount() const { return fRef; } diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp index 3f58cc69da..4aff202a9f 100644 --- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp +++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp @@ -34,7 +34,7 @@ namespace { // suppress no previsous prototype warning //////////////////////////////////////////////////////////////////////////////// GrGLvoid GR_GL_FUNCTION_TYPE debugGLActiveTexture(GrGLenum texture) { - + // Ganesh offsets the texture unit indices texture -= GR_GL_TEXTURE0; GrAlwaysAssert(texture < GrDebugGL::getInstance()->getMaxTextureUnits()); @@ -43,15 +43,15 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLActiveTexture(GrGLenum texture) { } //////////////////////////////////////////////////////////////////////////////// -GrGLvoid GR_GL_FUNCTION_TYPE debugGLAttachShader(GrGLuint programID, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLAttachShader(GrGLuint programID, GrGLuint shaderID) { - GrProgramObj *program = GR_FIND(programID, GrProgramObj, + GrProgramObj *program = GR_FIND(programID, GrProgramObj, GrDebugGL::kProgram_ObjTypes); GrAlwaysAssert(program); - GrShaderObj *shader = GR_FIND(shaderID, - GrShaderObj, + GrShaderObj *shader = GR_FIND(shaderID, + GrShaderObj, GrDebugGL::kShader_ObjTypes); GrAlwaysAssert(shader); @@ -61,51 +61,51 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLAttachShader(GrGLuint programID, GrGLvoid GR_GL_FUNCTION_TYPE debugGLBeginQuery(GrGLenum target, GrGLuint id) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindAttribLocation(GrGLuint program, - GrGLuint index, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindAttribLocation(GrGLuint program, + GrGLuint index, const char* name) { } //////////////////////////////////////////////////////////////////////////////// -GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindTexture(GrGLenum target, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindTexture(GrGLenum target, GrGLuint textureID) { // we don't use cube maps - GrAlwaysAssert(target == GR_GL_TEXTURE_2D); + GrAlwaysAssert(target == GR_GL_TEXTURE_2D); // || target == GR_GL_TEXTURE_CUBE_MAP); // a textureID of 0 is acceptable - it binds to the default texture target - GrTextureObj *texture = GR_FIND(textureID, GrTextureObj, + GrTextureObj *texture = GR_FIND(textureID, GrTextureObj, GrDebugGL::kTexture_ObjTypes); GrDebugGL::getInstance()->setTexture(texture); } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLBlendColor(GrGLclampf red, - GrGLclampf green, - GrGLclampf blue, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLBlendColor(GrGLclampf red, + GrGLclampf green, + GrGLclampf blue, GrGLclampf alpha) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindFragDataLocation(GrGLuint program, - GrGLuint colorNumber, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindFragDataLocation(GrGLuint program, + GrGLuint colorNumber, const GrGLchar* name) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLBlendFunc(GrGLenum sfactor, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLBlendFunc(GrGLenum sfactor, GrGLenum dfactor) { } //////////////////////////////////////////////////////////////////////////////// -GrGLvoid GR_GL_FUNCTION_TYPE debugGLBufferData(GrGLenum target, - GrGLsizeiptr size, - const GrGLvoid* data, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLBufferData(GrGLenum target, + GrGLsizeiptr size, + const GrGLvoid* data, GrGLenum usage) { - GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target || + GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target || GR_GL_ELEMENT_ARRAY_BUFFER == target); GrAlwaysAssert(size >= 0); - GrAlwaysAssert(GR_GL_STREAM_DRAW == usage || - GR_GL_STATIC_DRAW == usage || + GrAlwaysAssert(GR_GL_STREAM_DRAW == usage || + GR_GL_STATIC_DRAW == usage || GR_GL_DYNAMIC_DRAW == usage); GrBufferObj *buffer = NULL; @@ -128,40 +128,40 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLBufferData(GrGLenum target, buffer->setUsage(usage); } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLBufferSubData(GrGLenum target, - GrGLintptr offset, - GrGLsizeiptr size, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLBufferSubData(GrGLenum target, + GrGLintptr offset, + GrGLsizeiptr size, const GrGLvoid* data) { } GrGLvoid GR_GL_FUNCTION_TYPE debugGLClear(GrGLbitfield mask) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLClearColor(GrGLclampf red, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLClearColor(GrGLclampf red, GrGLclampf green, - GrGLclampf blue, + GrGLclampf blue, GrGLclampf alpha) { } GrGLvoid GR_GL_FUNCTION_TYPE debugGLClearStencil(GrGLint s) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLColorMask(GrGLboolean red, - GrGLboolean green, - GrGLboolean blue, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLColorMask(GrGLboolean red, + GrGLboolean green, + GrGLboolean blue, GrGLboolean alpha) { } GrGLvoid GR_GL_FUNCTION_TYPE debugGLCompileShader(GrGLuint shader) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLCompressedTexImage2D(GrGLenum target, - GrGLint level, - GrGLenum internalformat, - GrGLsizei width, - GrGLsizei height, - GrGLint border, - GrGLsizei imageSize, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLCompressedTexImage2D(GrGLenum target, + GrGLint level, + GrGLenum internalformat, + GrGLsizei width, + GrGLsizei height, + GrGLint border, + GrGLsizei imageSize, const GrGLvoid* data) { } @@ -177,21 +177,21 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLDisable(GrGLenum cap) { GrGLvoid GR_GL_FUNCTION_TYPE debugGLDisableVertexAttribArray(GrGLuint index) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLDrawArrays(GrGLenum mode, - GrGLint first, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLDrawArrays(GrGLenum mode, + GrGLint first, GrGLsizei count) { } GrGLvoid GR_GL_FUNCTION_TYPE debugGLDrawBuffer(GrGLenum mode) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLDrawBuffers(GrGLsizei n, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLDrawBuffers(GrGLsizei n, const GrGLenum* bufs) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLDrawElements(GrGLenum mode, - GrGLsizei count, - GrGLenum type, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLDrawElements(GrGLenum mode, + GrGLsizei count, + GrGLenum type, const GrGLvoid* indices) { } @@ -219,7 +219,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLLineWidth(GrGLfloat width) { GrGLvoid GR_GL_FUNCTION_TYPE debugGLLinkProgram(GrGLuint program) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLPixelStorei(GrGLenum pname, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLPixelStorei(GrGLenum pname, GrGLint param) { switch (pname) { @@ -240,19 +240,19 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLPixelStorei(GrGLenum pname, } } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLQueryCounter(GrGLuint id, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLQueryCounter(GrGLuint id, GrGLenum target) { } GrGLvoid GR_GL_FUNCTION_TYPE debugGLReadBuffer(GrGLenum src) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLReadPixels(GrGLint x, - GrGLint y, - GrGLsizei width, - GrGLsizei height, - GrGLenum format, - GrGLenum type, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLReadPixels(GrGLint x, + GrGLint y, + GrGLsizei width, + GrGLsizei height, + GrGLenum format, + GrGLenum type, GrGLvoid* pixels) { GrGLint pixelsInRow = width; @@ -297,8 +297,8 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLReadPixels(GrGLint x, if (componentSize >= alignment) { rowStride = componentsPerPixel * pixelsInRow; } else { - float fTemp = - sk_float_ceil(componentSize * componentsPerPixel * pixelsInRow / + float fTemp = + sk_float_ceil(componentSize * componentsPerPixel * pixelsInRow / static_cast<float>(alignment)); rowStride = static_cast<GrGLint>(alignment * fTemp / componentSize); } @@ -310,250 +310,250 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLReadPixels(GrGLint x, } } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLScissor(GrGLint x, - GrGLint y, - GrGLsizei width, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLScissor(GrGLint x, + GrGLint y, + GrGLsizei width, GrGLsizei height) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLShaderSource(GrGLuint shader, - GrGLsizei count, - const char** str, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLShaderSource(GrGLuint shader, + GrGLsizei count, + const char** str, const GrGLint* length) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLStencilFunc(GrGLenum func, - GrGLint ref, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLStencilFunc(GrGLenum func, + GrGLint ref, GrGLuint mask) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLStencilFuncSeparate(GrGLenum face, - GrGLenum func, - GrGLint ref, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLStencilFuncSeparate(GrGLenum face, + GrGLenum func, + GrGLint ref, GrGLuint mask) { } GrGLvoid GR_GL_FUNCTION_TYPE debugGLStencilMask(GrGLuint mask) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLStencilMaskSeparate(GrGLenum face, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLStencilMaskSeparate(GrGLenum face, GrGLuint mask) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLStencilOp(GrGLenum fail, - GrGLenum zfail, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLStencilOp(GrGLenum fail, + GrGLenum zfail, GrGLenum zpass) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLStencilOpSeparate(GrGLenum face, - GrGLenum fail, - GrGLenum zfail, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLStencilOpSeparate(GrGLenum face, + GrGLenum fail, + GrGLenum zfail, GrGLenum zpass) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexImage2D(GrGLenum target, - GrGLint level, - GrGLint internalformat, - GrGLsizei width, - GrGLsizei height, - GrGLint border, - GrGLenum format, - GrGLenum type, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexImage2D(GrGLenum target, + GrGLint level, + GrGLint internalformat, + GrGLsizei width, + GrGLsizei height, + GrGLint border, + GrGLenum format, + GrGLenum type, const GrGLvoid* pixels) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexParameteri(GrGLenum target, - GrGLenum pname, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexParameteri(GrGLenum target, + GrGLenum pname, GrGLint param) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexParameteriv(GrGLenum target, - GrGLenum pname, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexParameteriv(GrGLenum target, + GrGLenum pname, const GrGLint* params) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexStorage2D(GrGLenum target, - GrGLsizei levels, - GrGLenum internalformat, - GrGLsizei width, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexStorage2D(GrGLenum target, + GrGLsizei levels, + GrGLenum internalformat, + GrGLsizei width, GrGLsizei height) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexSubImage2D(GrGLenum target, - GrGLint level, - GrGLint xoffset, - GrGLint yoffset, - GrGLsizei width, - GrGLsizei height, - GrGLenum format, - GrGLenum type, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexSubImage2D(GrGLenum target, + GrGLint level, + GrGLint xoffset, + GrGLint yoffset, + GrGLsizei width, + GrGLsizei height, + GrGLenum format, + GrGLenum type, const GrGLvoid* pixels) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform1f(GrGLint location, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform1f(GrGLint location, GrGLfloat v0) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform1i(GrGLint location, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform1i(GrGLint location, GrGLint v0) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform1fv(GrGLint location, - GrGLsizei count, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform1fv(GrGLint location, + GrGLsizei count, const GrGLfloat* v) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform1iv(GrGLint location, - GrGLsizei count, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform1iv(GrGLint location, + GrGLsizei count, const GrGLint* v) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform2f(GrGLint location, - GrGLfloat v0, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform2f(GrGLint location, + GrGLfloat v0, GrGLfloat v1) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform2i(GrGLint location, - GrGLint v0, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform2i(GrGLint location, + GrGLint v0, GrGLint v1) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform2fv(GrGLint location, - GrGLsizei count, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform2fv(GrGLint location, + GrGLsizei count, const GrGLfloat* v) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform2iv(GrGLint location, - GrGLsizei count, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform2iv(GrGLint location, + GrGLsizei count, const GrGLint* v) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform3f(GrGLint location, - GrGLfloat v0, - GrGLfloat v1, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform3f(GrGLint location, + GrGLfloat v0, + GrGLfloat v1, GrGLfloat v2) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform3i(GrGLint location, - GrGLint v0, - GrGLint v1, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform3i(GrGLint location, + GrGLint v0, + GrGLint v1, GrGLint v2) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform3fv(GrGLint location, - GrGLsizei count, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform3fv(GrGLint location, + GrGLsizei count, const GrGLfloat* v) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform3iv(GrGLint location, - GrGLsizei count, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform3iv(GrGLint location, + GrGLsizei count, const GrGLint* v) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4f(GrGLint location, - GrGLfloat v0, - GrGLfloat v1, - GrGLfloat v2, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4f(GrGLint location, + GrGLfloat v0, + GrGLfloat v1, + GrGLfloat v2, GrGLfloat v3) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4i(GrGLint location, - GrGLint v0, - GrGLint v1, - GrGLint v2, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4i(GrGLint location, + GrGLint v0, + GrGLint v1, + GrGLint v2, GrGLint v3) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, - GrGLsizei count, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, + GrGLsizei count, const GrGLfloat* v) { } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4iv(GrGLint location, - GrGLsizei count, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4iv(GrGLint location, + GrGLsizei count, const GrGLint* v) { } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniformMatrix2fv(GrGLint location, - GrGLsizei count, - GrGLboolean transpose, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniformMatrix2fv(GrGLint location, + GrGLsizei count, + GrGLboolean transpose, const GrGLfloat* value) { } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniformMatrix3fv(GrGLint location, - GrGLsizei count, - GrGLboolean transpose, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniformMatrix3fv(GrGLint location, + GrGLsizei count, + GrGLboolean transpose, const GrGLfloat* value) { } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniformMatrix4fv(GrGLint location, - GrGLsizei count, - GrGLboolean transpose, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniformMatrix4fv(GrGLint location, + GrGLsizei count, + GrGLboolean transpose, const GrGLfloat* value) { } GrGLvoid GR_GL_FUNCTION_TYPE debugGLUseProgram(GrGLuint programID) { // A programID of 0 is legal - GrProgramObj *program = GR_FIND(programID, - GrProgramObj, + GrProgramObj *program = GR_FIND(programID, + GrProgramObj, GrDebugGL::kProgram_ObjTypes); GrDebugGL::getInstance()->useProgram(program); } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLVertexAttrib4fv(GrGLuint indx, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLVertexAttrib4fv(GrGLuint indx, const GrGLfloat* values) { } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLVertexAttribPointer(GrGLuint indx, - GrGLint size, - GrGLenum type, - GrGLboolean normalized, - GrGLsizei stride, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLVertexAttribPointer(GrGLuint indx, + GrGLint size, + GrGLenum type, + GrGLboolean normalized, + GrGLsizei stride, const GrGLvoid* ptr) { } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLViewport(GrGLint x, - GrGLint y, - GrGLsizei width, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLViewport(GrGLint x, + GrGLint y, + GrGLsizei width, GrGLsizei height) { } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindFramebuffer(GrGLenum target, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindFramebuffer(GrGLenum target, GrGLuint frameBufferID) { GrAlwaysAssert(GR_GL_FRAMEBUFFER == target); - // a frameBufferID of 0 is acceptable - it binds to the default + // a frameBufferID of 0 is acceptable - it binds to the default // frame buffer - GrFrameBufferObj *frameBuffer = GR_FIND(frameBufferID, - GrFrameBufferObj, + GrFrameBufferObj *frameBuffer = GR_FIND(frameBufferID, + GrFrameBufferObj, GrDebugGL::kFrameBuffer_ObjTypes); GrDebugGL::getInstance()->setFrameBuffer(frameBuffer); } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindRenderbuffer(GrGLenum target, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindRenderbuffer(GrGLenum target, GrGLuint renderBufferID) { GrAlwaysAssert(GR_GL_RENDERBUFFER == target); // a renderBufferID of 0 is acceptable - it unbinds the bound render buffer - GrRenderBufferObj *renderBuffer = GR_FIND(renderBufferID, - GrRenderBufferObj, + GrRenderBufferObj *renderBuffer = GR_FIND(renderBufferID, + GrRenderBufferObj, GrDebugGL::kRenderBuffer_ObjTypes); GrDebugGL::getInstance()->setRenderBuffer(renderBuffer); } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteTextures(GrGLsizei n, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteTextures(GrGLsizei n, const GrGLuint* textures) { // first potentially unbind the texture // TODO: move this into GrDebugGL as unBindTexture? - for (unsigned int i = 0; - i < GrDebugGL::getInstance()->getMaxTextureUnits(); + for (unsigned int i = 0; + i < GrDebugGL::getInstance()->getMaxTextureUnits(); ++i) { GrTextureUnitObj *pTU = GrDebugGL::getInstance()->getTextureUnit(i); @@ -569,7 +569,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, } // TODO: fuse the following block with DeleteRenderBuffers? - // Open GL will remove a deleted render buffer from the active + // Open GL will remove a deleted render buffer from the active // frame buffer but not from any other frame buffer if (GrDebugGL::getInstance()->getFrameBuffer()) { @@ -577,15 +577,15 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, for (int i = 0; i < n; ++i) { - if (NULL != frameBuffer->getColor() && + if (NULL != frameBuffer->getColor() && textures[i] == frameBuffer->getColor()->getID()) { frameBuffer->setColor(NULL); - } - if (NULL != frameBuffer->getDepth() && + } + if (NULL != frameBuffer->getDepth() && textures[i] == frameBuffer->getDepth()->getID()) { frameBuffer->setDepth(NULL); } - if (NULL != frameBuffer->getStencil() && + if (NULL != frameBuffer->getStencil() && textures[i] == frameBuffer->getStencil()->getID()) { frameBuffer->setStencil(NULL); } @@ -594,8 +594,8 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, // then actually "delete" the buffers for (int i = 0; i < n; ++i) { - GrTextureObj *buffer = GR_FIND(textures[i], - GrTextureObj, + GrTextureObj *buffer = GR_FIND(textures[i], + GrTextureObj, GrDebugGL::kTexture_ObjTypes); GrAlwaysAssert(buffer); @@ -610,14 +610,14 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteFramebuffers(GrGLsizei n, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteFramebuffers(GrGLsizei n, const GrGLuint *frameBuffers) { // first potentially unbind the buffers if (GrDebugGL::getInstance()->getFrameBuffer()) { for (int i = 0; i < n; ++i) { - if (frameBuffers[i] == + if (frameBuffers[i] == GrDebugGL::getInstance()->getFrameBuffer()->getID()) { // this ID is the current frame buffer - rebind to the default GrDebugGL::getInstance()->setFrameBuffer(NULL); @@ -627,8 +627,8 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, // then actually "delete" the buffers for (int i = 0; i < n; ++i) { - GrFrameBufferObj *buffer = GR_FIND(frameBuffers[i], - GrFrameBufferObj, + GrFrameBufferObj *buffer = GR_FIND(frameBuffers[i], + GrFrameBufferObj, GrDebugGL::kFrameBuffer_ObjTypes); GrAlwaysAssert(buffer); @@ -637,16 +637,16 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, } } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteRenderbuffers(GrGLsizei n, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteRenderbuffers(GrGLsizei n, const GrGLuint *renderBuffers) { // first potentially unbind the buffers if (GrDebugGL::getInstance()->getRenderBuffer()) { for (int i = 0; i < n; ++i) { - if (renderBuffers[i] == + if (renderBuffers[i] == GrDebugGL::getInstance()->getRenderBuffer()->getID()) { - // this ID is the current render buffer - make no + // this ID is the current render buffer - make no // render buffer be bound GrDebugGL::getInstance()->setRenderBuffer(NULL); } @@ -654,24 +654,24 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, } // TODO: fuse the following block with DeleteTextures? - // Open GL will remove a deleted render buffer from the active frame + // Open GL will remove a deleted render buffer from the active frame // buffer but not from any other frame buffer if (GrDebugGL::getInstance()->getFrameBuffer()) { - GrFrameBufferObj *frameBuffer = + GrFrameBufferObj *frameBuffer = GrDebugGL::getInstance()->getFrameBuffer(); for (int i = 0; i < n; ++i) { - if (NULL != frameBuffer->getColor() && + if (NULL != frameBuffer->getColor() && renderBuffers[i] == frameBuffer->getColor()->getID()) { frameBuffer->setColor(NULL); - } - if (NULL != frameBuffer->getDepth() && + } + if (NULL != frameBuffer->getDepth() && renderBuffers[i] == frameBuffer->getDepth()->getID()) { frameBuffer->setDepth(NULL); } - if (NULL != frameBuffer->getStencil() && + if (NULL != frameBuffer->getStencil() && renderBuffers[i] == frameBuffer->getStencil()->getID()) { frameBuffer->setStencil(NULL); } @@ -680,13 +680,13 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, // then actually "delete" the buffers for (int i = 0; i < n; ++i) { - GrRenderBufferObj *buffer = GR_FIND(renderBuffers[i], - GrRenderBufferObj, + GrRenderBufferObj *buffer = GR_FIND(renderBuffers[i], + GrRenderBufferObj, GrDebugGL::kRenderBuffer_ObjTypes); GrAlwaysAssert(buffer); - // OpenGL gives no guarantees if a render buffer is deleted - // while attached to something other than the currently + // OpenGL gives no guarantees if a render buffer is deleted + // while attached to something other than the currently // bound frame buffer GrAlwaysAssert(!buffer->getColorBound()); GrAlwaysAssert(!buffer->getDepthBound()); @@ -697,14 +697,14 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, } } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLFramebufferRenderbuffer(GrGLenum target, - GrGLenum attachment, - GrGLenum renderbuffertarget, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLFramebufferRenderbuffer(GrGLenum target, + GrGLenum attachment, + GrGLenum renderbuffertarget, GrGLuint renderBufferID) { GrAlwaysAssert(GR_GL_FRAMEBUFFER == target); - GrAlwaysAssert(GR_GL_COLOR_ATTACHMENT0 == attachment || - GR_GL_DEPTH_ATTACHMENT == attachment || + GrAlwaysAssert(GR_GL_COLOR_ATTACHMENT0 == attachment || + GR_GL_DEPTH_ATTACHMENT == attachment || GR_GL_STENCIL_ATTACHMENT == attachment); GrAlwaysAssert(GR_GL_RENDERBUFFER == renderbuffertarget); @@ -712,10 +712,10 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, // A render buffer cannot be attached to the default framebuffer GrAlwaysAssert(NULL != framebuffer); - // a renderBufferID of 0 is acceptable - it unbinds the current + // a renderBufferID of 0 is acceptable - it unbinds the current // render buffer - GrRenderBufferObj *renderbuffer = GR_FIND(renderBufferID, - GrRenderBufferObj, + GrRenderBufferObj *renderbuffer = GR_FIND(renderBufferID, + GrRenderBufferObj, GrDebugGL::kRenderBuffer_ObjTypes); switch (attachment) { @@ -736,15 +736,15 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, } //////////////////////////////////////////////////////////////////////////////// - GrGLvoid GR_GL_FUNCTION_TYPE debugGLFramebufferTexture2D(GrGLenum target, - GrGLenum attachment, - GrGLenum textarget, - GrGLuint textureID, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLFramebufferTexture2D(GrGLenum target, + GrGLenum attachment, + GrGLenum textarget, + GrGLuint textureID, GrGLint level) { GrAlwaysAssert(GR_GL_FRAMEBUFFER == target); - GrAlwaysAssert(GR_GL_COLOR_ATTACHMENT0 == attachment || - GR_GL_DEPTH_ATTACHMENT == attachment || + GrAlwaysAssert(GR_GL_COLOR_ATTACHMENT0 == attachment || + GR_GL_DEPTH_ATTACHMENT == attachment || GR_GL_STENCIL_ATTACHMENT == attachment); GrAlwaysAssert(GR_GL_TEXTURE_2D == textarget); @@ -753,10 +753,10 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, GrAlwaysAssert(NULL != framebuffer); // A textureID of 0 is allowed - it unbinds the currently bound texture - GrTextureObj *texture = GR_FIND(textureID, GrTextureObj, + GrTextureObj *texture = GR_FIND(textureID, GrTextureObj, GrDebugGL::kTexture_ObjTypes); if (texture) { - // The texture shouldn't be bound to a texture unit - this + // The texture shouldn't be bound to a texture unit - this // could lead to a feedback loop GrAlwaysAssert(!texture->getBound()); } @@ -779,48 +779,48 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform4fv(GrGLint location, }; } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetFramebufferAttachmentParameteriv(GrGLenum target, - GrGLenum attachment, - GrGLenum pname, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetFramebufferAttachmentParameteriv(GrGLenum target, + GrGLenum attachment, + GrGLenum pname, GrGLint* params) { } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetRenderbufferParameteriv(GrGLenum target, - GrGLenum pname, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetRenderbufferParameteriv(GrGLenum target, + GrGLenum pname, GrGLint* params) { } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLRenderbufferStorage(GrGLenum target, - GrGLenum internalformat, - GrGLsizei width, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLRenderbufferStorage(GrGLenum target, + GrGLenum internalformat, + GrGLsizei width, GrGLsizei height) { } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLRenderbufferStorageMultisample(GrGLenum target, - GrGLsizei samples, - GrGLenum internalformat, - GrGLsizei width, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLRenderbufferStorageMultisample(GrGLenum target, + GrGLsizei samples, + GrGLenum internalformat, + GrGLsizei width, GrGLsizei height) { } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLBlitFramebuffer(GrGLint srcX0, - GrGLint srcY0, - GrGLint srcX1, - GrGLint srcY1, - GrGLint dstX0, - GrGLint dstY0, - GrGLint dstX1, - GrGLint dstY1, - GrGLbitfield mask, + GrGLvoid GR_GL_FUNCTION_TYPE debugGLBlitFramebuffer(GrGLint srcX0, + GrGLint srcY0, + GrGLint srcX1, + GrGLint srcY1, + GrGLint dstX0, + GrGLint dstY0, + GrGLint dstX1, + GrGLint dstY1, + GrGLbitfield mask, GrGLenum filter) { } GrGLvoid GR_GL_FUNCTION_TYPE debugGLResolveMultisampleFramebuffer() { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindFragDataLocationIndexed(GrGLuint program, - GrGLuint colorNumber, - GrGLuint index, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindFragDataLocationIndexed(GrGLuint program, + GrGLuint colorNumber, + GrGLuint index, const GrGLchar * name) { } @@ -833,15 +833,15 @@ GrGLenum GR_GL_FUNCTION_TYPE debugGLCheckFramebufferStatus(GrGLenum target) { GrGLuint GR_GL_FUNCTION_TYPE debugGLCreateProgram() { - GrProgramObj *program = GR_CREATE(GrProgramObj, + GrProgramObj *program = GR_CREATE(GrProgramObj, GrDebugGL::kProgram_ObjTypes); return program->getID(); } GrGLuint GR_GL_FUNCTION_TYPE debugGLCreateShader(GrGLenum type) { - - GrAlwaysAssert(GR_GL_VERTEX_SHADER == type || + + GrAlwaysAssert(GR_GL_VERTEX_SHADER == type || GR_GL_FRAGMENT_SHADER == type); GrShaderObj *shader = GR_CREATE(GrShaderObj, GrDebugGL::kShader_ObjTypes); @@ -852,8 +852,8 @@ GrGLuint GR_GL_FUNCTION_TYPE debugGLCreateShader(GrGLenum type) { GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteProgram(GrGLuint programID) { - GrProgramObj *program = GR_FIND(programID, - GrProgramObj, + GrProgramObj *program = GR_FIND(programID, + GrProgramObj, GrDebugGL::kProgram_ObjTypes); GrAlwaysAssert(program); @@ -867,8 +867,8 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteProgram(GrGLuint programID) { GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteShader(GrGLuint shaderID) { - GrShaderObj *shader = GR_FIND(shaderID, - GrShaderObj, + GrShaderObj *shader = GR_FIND(shaderID, + GrShaderObj, GrDebugGL::kShader_ObjTypes); GrAlwaysAssert(shader); @@ -888,8 +888,8 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLGenIds(GrGLsizei n, GrGLuint* ids) { } } -GrGLvoid debugGenObjs(GrDebugGL::GrObjTypes type, - GrGLsizei n, +GrGLvoid debugGenObjs(GrDebugGL::GrObjTypes type, + GrGLsizei n, GrGLuint* ids) { for (int i = 0; i < n; ++i) { @@ -904,13 +904,13 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLGenBuffers(GrGLsizei n, GrGLuint* ids) { debugGenObjs(GrDebugGL::kBuffer_ObjTypes, n, ids); } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLGenFramebuffers(GrGLsizei n, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLGenFramebuffers(GrGLsizei n, GrGLuint* ids) { debugGenObjs(GrDebugGL::kFrameBuffer_ObjTypes, n, ids); } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLGenRenderbuffers(GrGLsizei n, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLGenRenderbuffers(GrGLsizei n, GrGLuint* ids) { debugGenObjs(GrDebugGL::kRenderBuffer_ObjTypes, n, ids); @@ -921,20 +921,20 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLGenTextures(GrGLsizei n, GrGLuint* ids) { debugGenObjs(GrDebugGL::kTexture_ObjTypes, n, ids); } -// same delete function for all glDelete*(GLsize i, const GLuint*) except +// same delete function for all glDelete*(GLsize i, const GLuint*) except // buffers -GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteIds(GrGLsizei n, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteIds(GrGLsizei n, const GrGLuint* ids) { } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindBuffer(GrGLenum target, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindBuffer(GrGLenum target, GrGLuint bufferID) { - GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target || + GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target || GR_GL_ELEMENT_ARRAY_BUFFER == target); - GrBufferObj *buffer = GR_FIND(bufferID, - GrBufferObj, + GrBufferObj *buffer = GR_FIND(bufferID, + GrBufferObj, GrDebugGL::kBuffer_ObjTypes); // 0 is a permissable bufferID - it unbinds the current buffer @@ -952,18 +952,18 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindBuffer(GrGLenum target, } // deleting a bound buffer has the side effect of binding 0 -GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteBuffers(GrGLsizei n, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteBuffers(GrGLsizei n, const GrGLuint* ids) { // first potentially unbind the buffers for (int i = 0; i < n; ++i) { - if (GrDebugGL::getInstance()->getArrayBuffer() && + if (GrDebugGL::getInstance()->getArrayBuffer() && ids[i] == GrDebugGL::getInstance()->getArrayBuffer()->getID()) { // this ID is the current array buffer GrDebugGL::getInstance()->setArrayBuffer(NULL); } - if (GrDebugGL::getInstance()->getElementArrayBuffer() && - ids[i] == + if (GrDebugGL::getInstance()->getElementArrayBuffer() && + ids[i] == GrDebugGL::getInstance()->getElementArrayBuffer()->getID()) { // this ID is the current element array buffer GrDebugGL::getInstance()->setElementArrayBuffer(NULL); @@ -972,8 +972,8 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteBuffers(GrGLsizei n, // then actually "delete" the buffers for (int i = 0; i < n; ++i) { - GrBufferObj *buffer = GR_FIND(ids[i], - GrBufferObj, + GrBufferObj *buffer = GR_FIND(ids[i], + GrBufferObj, GrDebugGL::kBuffer_ObjTypes); GrAlwaysAssert(buffer); @@ -983,13 +983,13 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteBuffers(GrGLsizei n, } // map a buffer to the caller's address space -GrGLvoid* GR_GL_FUNCTION_TYPE debugGLMapBuffer(GrGLenum target, +GrGLvoid* GR_GL_FUNCTION_TYPE debugGLMapBuffer(GrGLenum target, GrGLenum access) { - GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target || + GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target || GR_GL_ELEMENT_ARRAY_BUFFER == target); // GR_GL_READ_ONLY == access || || GR_GL_READ_WRIT == access); - GrAlwaysAssert(GR_GL_WRITE_ONLY == access); + GrAlwaysAssert(GR_GL_WRITE_ONLY == access); GrBufferObj *buffer = NULL; switch (target) { @@ -1015,10 +1015,10 @@ GrGLvoid* GR_GL_FUNCTION_TYPE debugGLMapBuffer(GrGLenum target, } // remove a buffer from the caller's address space -// TODO: check if the "access" method from "glMapBuffer" was honored +// TODO: check if the "access" method from "glMapBuffer" was honored GrGLboolean GR_GL_FUNCTION_TYPE debugGLUnmapBuffer(GrGLenum target) { - GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target || + GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target || GR_GL_ELEMENT_ARRAY_BUFFER == target); GrBufferObj *buffer = NULL; @@ -1044,13 +1044,13 @@ GrGLboolean GR_GL_FUNCTION_TYPE debugGLUnmapBuffer(GrGLenum target) { return GR_GL_FALSE; // GR_GL_INVALID_OPERATION; } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetBufferParameteriv(GrGLenum target, - GrGLenum value, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetBufferParameteriv(GrGLenum target, + GrGLenum value, GrGLint* params) { - GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target || + GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target || GR_GL_ELEMENT_ARRAY_BUFFER == target); - GrAlwaysAssert(GR_GL_BUFFER_SIZE == value || + GrAlwaysAssert(GR_GL_BUFFER_SIZE == value || GR_GL_BUFFER_USAGE == value); GrBufferObj *buffer = NULL; @@ -1060,7 +1060,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetBufferParameteriv(GrGLenum target, break; case GR_GL_ELEMENT_ARRAY_BUFFER: buffer = GrDebugGL::getInstance()->getElementArrayBuffer(); - break; + break; } GrAlwaysAssert(buffer); @@ -1091,7 +1091,7 @@ GrGLenum GR_GL_FUNCTION_TYPE debugGLGetError() { return GR_GL_NO_ERROR; } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetIntegerv(GrGLenum pname, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetIntegerv(GrGLenum pname, GrGLint* params) { // TODO: remove from Ganesh the #defines for gets we don't use. // We would like to minimize gets overall due to performance issues @@ -1148,9 +1148,9 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetIntegerv(GrGLenum pname, } } // used for both the program and shader info logs -GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetInfoLog(GrGLuint program, - GrGLsizei bufsize, - GrGLsizei* length, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetInfoLog(GrGLuint program, + GrGLsizei bufsize, + GrGLsizei* length, char* infolog) { if (length) { *length = 0; @@ -1161,8 +1161,8 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetInfoLog(GrGLuint program, } // used for both the program and shader params -GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetShaderOrProgramiv(GrGLuint program, - GrGLenum pname, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetShaderOrProgramiv(GrGLuint program, + GrGLenum pname, GrGLint* params) { switch (pname) { case GR_GL_LINK_STATUS: // fallthru @@ -1196,10 +1196,10 @@ void query_result(GrGLenum GLtarget, GrGLenum pname, T *params) { } } -// Queries on the null GL just don't do anything at all. We could potentially +// Queries on the null GL just don't do anything at all. We could potentially // make the timers work. -GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetQueryiv(GrGLenum GLtarget, - GrGLenum pname, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetQueryiv(GrGLenum GLtarget, + GrGLenum pname, GrGLint *params) { switch (pname) { case GR_GL_CURRENT_QUERY: @@ -1213,26 +1213,26 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetQueryiv(GrGLenum GLtarget, } } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetQueryObjecti64v(GrGLuint id, - GrGLenum pname, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetQueryObjecti64v(GrGLuint id, + GrGLenum pname, GrGLint64 *params) { query_result(id, pname, params); } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetQueryObjectiv(GrGLuint id, - GrGLenum pname, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetQueryObjectiv(GrGLuint id, + GrGLenum pname, GrGLint *params) { query_result(id, pname, params); } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetQueryObjectui64v(GrGLuint id, - GrGLenum pname, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetQueryObjectui64v(GrGLuint id, + GrGLenum pname, GrGLuint64 *params) { query_result(id, pname, params); } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetQueryObjectuiv(GrGLuint id, - GrGLenum pname, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetQueryObjectuiv(GrGLuint id, + GrGLenum pname, GrGLuint *params) { query_result(id, pname, params); } @@ -1255,16 +1255,16 @@ const GrGLubyte* GR_GL_FUNCTION_TYPE debugGLGetString(GrGLenum name) { } } -// we used to use this to query stuff about externally created textures, +// we used to use this to query stuff about externally created textures, // now we just require clients to tell us everything about the texture. -GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetTexLevelParameteriv(GrGLenum target, - GrGLint level, - GrGLenum pname, +GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetTexLevelParameteriv(GrGLenum target, + GrGLint level, + GrGLenum pname, GrGLint* params) { GrCrash("Should never query texture parameters."); } -GrGLint GR_GL_FUNCTION_TYPE debugGLGetUniformLocation(GrGLuint program, +GrGLint GR_GL_FUNCTION_TYPE debugGLGetUniformLocation(GrGLuint program, const char* name) { static int gUniLocation = 0; return ++gUniLocation; @@ -1295,25 +1295,25 @@ public: // debug interface: // Since none of the "gl" methods are member functions they don't get // a "this" pointer through which to access "fWrapped" - // This could be worked around by having all of them access the - // "glInterface" pointer - i.e., treating the debug interface as a + // This could be worked around by having all of them access the + // "glInterface" pointer - i.e., treating the debug interface as a // true singleton // - // The problem with this is that we also want to handle OpenGL - // contexts. The natural way to do this is to have multiple debug - // interfaces. Each of which represents a separate context. The - // static ID count would still uniquify IDs across all of them. - // The problem then is that we couldn't treat the debug GL - // interface as a singleton (since there would be one for each + // The problem with this is that we also want to handle OpenGL + // contexts. The natural way to do this is to have multiple debug + // interfaces. Each of which represents a separate context. The + // static ID count would still uniquify IDs across all of them. + // The problem then is that we couldn't treat the debug GL + // interface as a singleton (since there would be one for each // context). // - // The solution to this is probably to alter SkDebugGlContext's - // "makeCurrent" method to make a call like "makeCurrent(this)" to - // the debug GL interface (assuming that the application will create - // multiple SkGLContext's) to let it switch between the active - // context. Everything in the GrDebugGL object would then need to be - // moved to a GrContextObj and the GrDebugGL object would just switch - // between them. Note that this approach would also require that + // The solution to this is probably to alter SkDebugGlContext's + // "makeCurrent" method to make a call like "makeCurrent(this)" to + // the debug GL interface (assuming that the application will create + // multiple SkGLContext's) to let it switch between the active + // context. Everything in the GrDebugGL object would then need to be + // moved to a GrContextObj and the GrDebugGL object would just switch + // between them. Note that this approach would also require that // SkDebugGLContext wrap an arbitrary other context // and then pass the wrapped interface to the debug GL interface. @@ -1439,18 +1439,18 @@ const GrGLInterface* GrGLCreateDebugInterface() { interface->fFramebufferTexture2D = debugGLFramebufferTexture2D; interface->fGenFramebuffers = debugGLGenFramebuffers; interface->fGenRenderbuffers = debugGLGenRenderbuffers; - interface->fGetFramebufferAttachmentParameteriv = + interface->fGetFramebufferAttachmentParameteriv = debugGLGetFramebufferAttachmentParameteriv; interface->fGetRenderbufferParameteriv = debugGLGetRenderbufferParameteriv; interface->fRenderbufferStorage = debugGLRenderbufferStorage; - interface->fRenderbufferStorageMultisample = + interface->fRenderbufferStorageMultisample = debugGLRenderbufferStorageMultisample; interface->fBlitFramebuffer = debugGLBlitFramebuffer; - interface->fResolveMultisampleFramebuffer = + interface->fResolveMultisampleFramebuffer = debugGLResolveMultisampleFramebuffer; interface->fMapBuffer = debugGLMapBuffer; interface->fUnmapBuffer = debugGLUnmapBuffer; - interface->fBindFragDataLocationIndexed = + interface->fBindFragDataLocationIndexed = debugGLBindFragDataLocationIndexed; return interface; diff --git a/src/gpu/gl/debug/GrShaderObj.h b/src/gpu/gl/debug/GrShaderObj.h index 0e1123713e..0b888fa0b2 100644 --- a/src/gpu/gl/debug/GrShaderObj.h +++ b/src/gpu/gl/debug/GrShaderObj.h @@ -17,7 +17,7 @@ class GrShaderObj : public GrFakeRefObj { GR_DEFINE_CREATOR(GrShaderObj); public: - GrShaderObj() + GrShaderObj() : GrFakeRefObj() , fType(GR_GL_VERTEX_SHADER) {} diff --git a/src/gpu/gl/debug/GrTextureObj.h b/src/gpu/gl/debug/GrTextureObj.h index 0443ab7c7a..7673cd118e 100644 --- a/src/gpu/gl/debug/GrTextureObj.h +++ b/src/gpu/gl/debug/GrTextureObj.h @@ -18,7 +18,7 @@ class GrTextureObj : public GrFBBindableObj { GR_DEFINE_CREATOR(GrTextureObj); public: - GrTextureObj() + GrTextureObj() : GrFBBindableObj() { } @@ -26,20 +26,20 @@ public: GrAlwaysAssert(0 == fTextureUnitReferees.count()); } - void setBound(GrTextureUnitObj *referee) { + void setBound(GrTextureUnitObj *referee) { fTextureUnitReferees.append(1, &referee); } - void resetBound(GrTextureUnitObj *referee) { + void resetBound(GrTextureUnitObj *referee) { int index = fTextureUnitReferees.find(referee); GrAlwaysAssert(0 <= index); fTextureUnitReferees.removeShuffle(index); } - bool getBound(GrTextureUnitObj *referee) const { + bool getBound(GrTextureUnitObj *referee) const { int index = fTextureUnitReferees.find(referee); return 0 <= index; } - bool getBound() const { + bool getBound() const { return 0 != fTextureUnitReferees.count(); } @@ -49,7 +49,7 @@ protected: private: // texture units that bind this texture (via "glBindTexture") - SkTDArray<GrTextureUnitObj *> fTextureUnitReferees; + SkTDArray<GrTextureUnitObj *> fTextureUnitReferees; typedef GrFBBindableObj INHERITED; }; diff --git a/src/gpu/gl/debug/GrTextureUnitObj.cpp b/src/gpu/gl/debug/GrTextureUnitObj.cpp index 05c149a1c0..b7c7b0ca57 100644 --- a/src/gpu/gl/debug/GrTextureUnitObj.cpp +++ b/src/gpu/gl/debug/GrTextureUnitObj.cpp @@ -9,7 +9,7 @@ #include "GrTextureUnitObj.h" #include "GrTextureObj.h" -void GrTextureUnitObj::setTexture(GrTextureObj *texture) { +void GrTextureUnitObj::setTexture(GrTextureObj *texture) { if (fTexture) { GrAlwaysAssert(fTexture->getBound(this)); @@ -19,7 +19,7 @@ void GrTextureUnitObj::setTexture(GrTextureObj *texture) { fTexture->unref(); } - fTexture = texture; + fTexture = texture; if (fTexture) { GrAlwaysAssert(!fTexture->getDeleted()); |