Bug 612171 - Regression: severe scrolling glitches with GL layers - r=joe, a=blocking-beta8
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 15 Nov 2010 18:13:56 -0500
changeset 57553 ba45d6b7fce254287f3b5fe0c6e01b1145d25b64
parent 57552 d81f20da03b841fd540b4fdaf7d2a60fc5fb8df9
child 57554 9b8ee895f234a4a7226f2b8a75e8e399d8ce7777
push id16976
push userbjacob@mozilla.com
push dateMon, 15 Nov 2010 23:14:52 +0000
treeherdermozilla-central@ba45d6b7fce2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe, blocking-beta8
bugs612171
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 612171 - Regression: severe scrolling glitches with GL layers - r=joe, a=blocking-beta8
gfx/thebes/GLContext.cpp
--- a/gfx/thebes/GLContext.cpp
+++ b/gfx/thebes/GLContext.cpp
@@ -536,19 +536,25 @@ gfxContext*
 BasicTextureImage::BeginUpdate(nsIntRegion& aRegion)
 {
     NS_ASSERTION(!mUpdateContext, "BeginUpdate() without EndUpdate()?");
 
     // determine the region the client will need to repaint
     ImageFormat format =
         (GetContentType() == gfxASurface::CONTENT_COLOR) ?
         gfxASurface::ImageFormatRGB24 : gfxASurface::ImageFormatARGB32;
-    if (!mTextureInited || !mBackingSurface ||
-        mBackingSurface->GetSize() != gfxIntSize(mSize.width, mSize.height) ||
-        mBackingSurface->Format() != format) {
+    PRBool repaintEverything = PR_FALSE;
+    if (mGLContext->IsExtensionSupported(gl::GLContext::APPLE_client_storage)) {
+        repaintEverything =
+            !(mBackingSurface &&
+              mBackingSurface->GetSize() == gfxIntSize(mSize.width, mSize.height) &&
+              mBackingSurface->Format() == format);
+    }
+    if (!mTextureInited || repaintEverything)
+    {
         // if the texture hasn't been initialized yet, or something important
         // changed, we need to recreate our backing surface and force the
         // client to paint everything
         mUpdateRect = nsIntRect(nsIntPoint(0, 0), mSize);
         mTextureInited = PR_FALSE;
     } else {
         mUpdateRect = aRegion.GetBounds();
     }