Bug 636609 - Remove DEBUG_GL_ERROR_CHECK. r+a=joe

This commit is contained in:
Matt Woodrow 2011-02-25 20:05:31 +13:00
parent 78ff119bd3
commit a15340f7c5
8 changed files with 0 additions and 89 deletions

View File

@ -217,7 +217,6 @@ CanvasLayerOGL::RenderLayer(int aPreviousDestination,
gl()->MakeCurrent();
gl()->BindTex2DOffscreen(mCanvasGLContext);
DEBUG_GL_ERROR_CHECK(gl());
program = mOGLManager->GetBasicLayerProgram(CanUseOpaqueSurface(), PR_TRUE);
} else if (mDelayedUpdates) {
NS_ABORT_IF_FALSE(mCanvasSurface, "WebGL canvases should always be using full texture upload");
@ -246,8 +245,6 @@ CanvasLayerOGL::RenderLayer(int aPreviousDestination,
mOGLManager->BindAndDrawQuad(program, mNeedsYFlip ? true : false);
DEBUG_GL_ERROR_CHECK(gl());
if (useGLContext) {
gl()->UnbindTex2DOffscreen(mCanvasGLContext);
}
@ -344,8 +341,6 @@ ShadowCanvasLayerOGL::RenderLayer(int aPreviousFrameBuffer,
program->SetTextureUnit(0);
mOGLManager->BindAndDrawQuad(program);
DEBUG_GL_ERROR_CHECK(gl());
}
#endif // MOZ_IPC

View File

@ -71,8 +71,6 @@ RenderColorLayer(ColorLayer* aLayer, LayerManagerOGL *aManager,
program->SetRenderColor(color);
aManager->BindAndDrawQuad(program);
DEBUG_GL_ERROR_CHECK(aManager->gl());
}
void

View File

@ -332,16 +332,10 @@ ContainerRender(Container* aContainer,
2, f);
}
DEBUG_GL_ERROR_CHECK(aContainer->gl());
aManager->BindAndDrawQuad(rgb, aManager->IsDrawingFlipped());
DEBUG_GL_ERROR_CHECK(aContainer->gl());
// Clean up resources. This also unbinds the texture.
aContainer->gl()->fDeleteTextures(1, &containerSurface);
DEBUG_GL_ERROR_CHECK(aContainer->gl());
}
}

View File

@ -432,8 +432,6 @@ ImageLayerOGL::RenderLayer(int,
program->SetRenderOffset(aOffset);
program->SetYCbCrTextureUnits(0, 1, 2);
DEBUG_GL_ERROR_CHECK(gl());
mOGLManager->BindAndDrawQuad(program);
// We shouldn't need to do this, but do it anyway just in case
@ -503,8 +501,6 @@ ImageLayerOGL::RenderLayer(int,
gl()->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, 0);
#endif
}
DEBUG_GL_ERROR_CHECK(gl());
}
static void
@ -839,8 +835,6 @@ ShadowImageLayerOGL::RenderLayer(int aPreviousFrameBuffer,
program->SetTextureUnit(0);
mOGLManager->BindAndDrawQuad(program);
DEBUG_GL_ERROR_CHECK(gl());
}
#endif // MOZ_IPC

View File

@ -182,8 +182,6 @@ LayerManagerOGL::Initialize(nsRefPtr<GLContext> aContext)
MakeCurrent();
DEBUG_GL_ERROR_CHECK(mGLContext);
mHasBGRA =
mGLContext->IsExtensionSupported(gl::GLContext::EXT_texture_format_BGRA8888) ||
mGLContext->IsExtensionSupported(gl::GLContext::EXT_bgra);
@ -318,8 +316,6 @@ LayerManagerOGL::Initialize(nsRefPtr<GLContext> aContext)
// back to default framebuffer, to avoid confusion
mGLContext->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, 0);
DEBUG_GL_ERROR_CHECK(mGLContext);
/* Create a simple quad VBO */
mGLContext->fGenBuffers(1, &mQuadVBO);
@ -335,8 +331,6 @@ LayerManagerOGL::Initialize(nsRefPtr<GLContext> aContext)
};
mGLContext->fBufferData(LOCAL_GL_ARRAY_BUFFER, sizeof(vertices), vertices, LOCAL_GL_STATIC_DRAW);
DEBUG_GL_ERROR_CHECK(mGLContext);
nsCOMPtr<nsIConsoleService>
console(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
@ -360,8 +354,6 @@ LayerManagerOGL::Initialize(nsRefPtr<GLContext> aContext)
console->LogStringMessage(msg.get());
}
DEBUG_GL_ERROR_CHECK(mGLContext);
return true;
}
@ -575,8 +567,6 @@ LayerManagerOGL::Render()
MakeCurrent();
}
DEBUG_GL_ERROR_CHECK(mGLContext);
SetupBackBuffer(width, height);
SetupPipeline(width, height, ApplyWorldTransform);
@ -585,8 +575,6 @@ LayerManagerOGL::Render()
LOCAL_GL_ONE, LOCAL_GL_ONE);
mGLContext->fEnable(LOCAL_GL_BLEND);
DEBUG_GL_ERROR_CHECK(mGLContext);
const nsIntRect *clipRect = mRoot->GetClipRect();
if (clipRect) {
@ -601,8 +589,6 @@ LayerManagerOGL::Render()
mGLContext->fEnable(LOCAL_GL_SCISSOR_TEST);
DEBUG_GL_ERROR_CHECK(mGLContext);
mGLContext->fClearColor(0.0, 0.0, 0.0, 0.0);
mGLContext->fClear(LOCAL_GL_COLOR_BUFFER_BIT | LOCAL_GL_DEPTH_BUFFER_BIT);
@ -612,8 +598,6 @@ LayerManagerOGL::Render()
static_cast<nsIWidget_MOZILLA_2_0_BRANCH*>(mWidget)->DrawOver(this, rect);
DEBUG_GL_ERROR_CHECK(mGLContext);
if (mTarget) {
CopyToTarget();
return;
@ -645,8 +629,6 @@ LayerManagerOGL::Render()
2, f);
}
DEBUG_GL_ERROR_CHECK(mGLContext);
// we're going to use client-side vertex arrays for this.
mGLContext->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, 0);
@ -698,17 +680,12 @@ LayerManagerOGL::Render()
0, coords);
mGLContext->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4);
DEBUG_GL_ERROR_CHECK(mGLContext);
}
mGLContext->fDisableVertexAttribArray(vcattr);
mGLContext->fDisableVertexAttribArray(tcattr);
DEBUG_GL_ERROR_CHECK(mGLContext);
mGLContext->fFlush();
DEBUG_GL_ERROR_CHECK(mGLContext);
}
void
@ -979,8 +956,6 @@ LayerManagerOGL::CreateFBOWithTexture(const nsIntRect& aRect, InitMode aInit,
*aFBO = fbo;
*aTexture = tex;
DEBUG_GL_ERROR_CHECK(gl());
}
void LayerOGL::ApplyFilter(gfxPattern::GraphicsFilter aFilter)

View File

@ -124,22 +124,17 @@ BindAndDrawQuadWithTextureRect(GLContext* aGl,
LOCAL_GL_FLOAT, LOCAL_GL_FALSE, 0,
rects.texCoords);
DEBUG_GL_ERROR_CHECK(aGl);
{
aGl->fEnableVertexAttribArray(texCoordAttribIndex);
{
aGl->fEnableVertexAttribArray(vertAttribIndex);
aGl->fDrawArrays(LOCAL_GL_TRIANGLES, 0, rects.numRects * 6);
DEBUG_GL_ERROR_CHECK(aGl);
aGl->fDisableVertexAttribArray(vertAttribIndex);
}
aGl->fDisableVertexAttribArray(texCoordAttribIndex);
}
DEBUG_GL_ERROR_CHECK(aGl);
}
@ -225,7 +220,6 @@ ThebesLayerBufferOGL::RenderTo(const nsIntPoint& aOffset,
}
alphaProgram->Activate();
DEBUG_GL_ERROR_CHECK(gl());
alphaProgram->SetBlackTextureUnit(0);
alphaProgram->SetWhiteTextureUnit(1);
program = alphaProgram;
@ -237,7 +231,6 @@ ThebesLayerBufferOGL::RenderTo(const nsIntPoint& aOffset,
mTexImage->IsRGB());
basicProgram->Activate();
DEBUG_GL_ERROR_CHECK(gl());
basicProgram->SetTextureUnit(0);
program = basicProgram;
}
@ -250,7 +243,6 @@ ThebesLayerBufferOGL::RenderTo(const nsIntPoint& aOffset,
while (const nsIntRect *iterRect = iter.Next()) {
nsIntRect quadRect = *iterRect;
program->SetLayerQuadRect(quadRect);
DEBUG_GL_ERROR_CHECK(gl());
quadRect.MoveBy(-GetOriginOffset());
@ -263,7 +255,6 @@ ThebesLayerBufferOGL::RenderTo(const nsIntPoint& aOffset,
BindAndDrawQuadWithTextureRect(gl(), program, quadRect,
mTexImage->GetSize(),
mTexImage->GetWrapMode());
DEBUG_GL_ERROR_CHECK(gl());
}
}
@ -497,13 +488,11 @@ BasicBufferOGL::BeginPaint(ContentType aContentType,
// So allocate a new buffer for the destination.
destBufferRect = visibleBounds;
destBuffer = CreateClampOrRepeatTextureImage(gl(), destBufferDims, aContentType);
DEBUG_GL_ERROR_CHECK(gl());
if (!destBuffer)
return result;
if (mode == Layer::SURFACE_COMPONENT_ALPHA) {
destBufferOnWhite =
CreateClampOrRepeatTextureImage(gl(), destBufferDims, aContentType);
DEBUG_GL_ERROR_CHECK(gl());
if (!destBufferOnWhite)
return result;
}
@ -522,14 +511,12 @@ BasicBufferOGL::BeginPaint(ContentType aContentType,
// The buffer's not big enough, so allocate a new one
destBufferRect = visibleBounds;
destBuffer = CreateClampOrRepeatTextureImage(gl(), destBufferDims, aContentType);
DEBUG_GL_ERROR_CHECK(gl());
if (!destBuffer)
return result;
if (mode == Layer::SURFACE_COMPONENT_ALPHA) {
destBufferOnWhite =
CreateClampOrRepeatTextureImage(gl(), destBufferDims, aContentType);
DEBUG_GL_ERROR_CHECK(gl());
if (!destBufferOnWhite)
return result;
}
@ -669,8 +656,6 @@ ThebesLayerOGL::Destroy()
{
if (!mDestroyed) {
mBuffer = nsnull;
DEBUG_GL_ERROR_CHECK(gl());
mDestroyed = PR_TRUE;
}
}
@ -759,11 +744,8 @@ ThebesLayerOGL::RenderLayer(int aPreviousFrameBuffer,
// Drawing thebes layers can change the current context, reset it.
gl()->MakeCurrent();
DEBUG_GL_ERROR_CHECK(gl());
gl()->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, aPreviousFrameBuffer);
mBuffer->RenderTo(aOffset, mOGLManager);
DEBUG_GL_ERROR_CHECK(gl());
}
Layer*
@ -948,11 +930,9 @@ ShadowThebesLayerOGL::RenderLayer(int aPreviousFrameBuffer,
mOGLManager->MakeCurrent();
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
DEBUG_GL_ERROR_CHECK(gl());
gl()->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, aPreviousFrameBuffer);
mBuffer->RenderTo(aOffset, mOGLManager);
DEBUG_GL_ERROR_CHECK(gl());
}
#endif // MOZ_IPC

View File

@ -534,7 +534,6 @@ GLContext::CreateTextureImage(const nsIntSize& aSize,
fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MAG_FILTER, texfilter);
fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_S, aWrapMode);
fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_T, aWrapMode);
DEBUG_GL_ERROR_CHECK(this);
return CreateBasicTextureImage(texture, aSize, aWrapMode, aContentType, this);
}
@ -1176,12 +1175,8 @@ GLContext::BlitTextureImage(TextureImage *aSrc, const nsIntRect& aSrcRect,
SetBlitFramebufferForDestTexture(aDst->Texture());
DEBUG_GL_ERROR_CHECK(this);
UseBlitProgram();
DEBUG_GL_ERROR_CHECK(this);
nsIntSize srcSize = aSrc->GetSize();
nsIntSize dstSize = aDst->GetSize();
@ -1225,12 +1220,8 @@ GLContext::BlitTextureImage(TextureImage *aSrc, const nsIntRect& aSrcRect,
fEnableVertexAttribArray(0);
fEnableVertexAttribArray(1);
DEBUG_GL_ERROR_CHECK(this);
fDrawArrays(LOCAL_GL_TRIANGLES, 0, rects.numRects * 6);
DEBUG_GL_ERROR_CHECK(this);
fDisableVertexAttribArray(0);
fDisableVertexAttribArray(1);

View File

@ -2067,22 +2067,6 @@ public:
};
inline void
GLDebugPrintError(GLContext* aCx, const char* const aFile, int aLine)
{
aCx->MakeCurrent();
GLenum err = aCx->fGetError();
if (err) {
printf_stderr("GL ERROR: 0x%04x at %s:%d\n", err, aFile, aLine);
}
}
#ifdef DEBUG
# define DEBUG_GL_ERROR_CHECK(cx) mozilla::gl::GLDebugPrintError(cx, __FILE__, __LINE__)
#else
# define DEBUG_GL_ERROR_CHECK(cx) do { } while (0)
#endif
inline PRBool
DoesVendorStringMatch(const char* aVendorString, const char *aWantedVendor)
{