From 692c620f70bd63be5597be695c2e4934cf3b3c34 Mon Sep 17 00:00:00 2001 From: Oleg Romashin Date: Mon, 24 Jan 2011 21:31:35 +0200 Subject: [PATCH] Bug 627661 - RGBA surface clear was broken in 593733 r=roc,mattwoodrow a=approval2.0 --- gfx/layers/opengl/ThebesLayerOGL.cpp | 6 ++++++ gfx/thebes/GLContext.cpp | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gfx/layers/opengl/ThebesLayerOGL.cpp b/gfx/layers/opengl/ThebesLayerOGL.cpp index 5928ce42ece..f2038b53c06 100644 --- a/gfx/layers/opengl/ThebesLayerOGL.cpp +++ b/gfx/layers/opengl/ThebesLayerOGL.cpp @@ -595,6 +595,12 @@ BasicBufferOGL::BeginPaint(ContentType aContentType) result.mContext = new gfxContext(surf); } else { result.mContext = new gfxContext(mTexImage->BeginUpdate(result.mRegionToDraw)); + if (mTexImage->GetContentType() == gfxASurface::CONTENT_COLOR_ALPHA) { + gfxUtils::ClipToRegion(result.mContext, result.mRegionToDraw); + result.mContext->SetOperator(gfxContext::OPERATOR_CLEAR); + result.mContext->Fill(); + result.mContext->SetOperator(gfxContext::OPERATOR_OVER); + } } if (!result.mContext) { NS_WARNING("unable to get context for update"); diff --git a/gfx/thebes/GLContext.cpp b/gfx/thebes/GLContext.cpp index 59bde425c78..625f3da3375 100644 --- a/gfx/thebes/GLContext.cpp +++ b/gfx/thebes/GLContext.cpp @@ -589,13 +589,6 @@ BasicTextureImage::BeginUpdate(nsIntRegion& aRegion) mUpdateSurface->SetDeviceOffset(gfxPoint(-rgnSize.x, -rgnSize.y)); - if (format == gfxASurface::ImageFormatARGB32) { - // Clear the returned surface because it might have been re-used. - nsRefPtr ctx = new gfxContext(mUpdateSurface); - ctx->SetOperator(gfxContext::OPERATOR_CLEAR); - ctx->Paint(); - } - return mUpdateSurface; }