Bug 796182; fix invalidation on Mac with OMTC; r=cjones
authorNicholas Cameron <ncameron@mozilla.com>
Thu, 04 Oct 2012 20:45:48 +1300
changeset 115520 136440ce1cd0d7831f8da46681c537498529d4b4
parent 115519 b9336d5fe02e6f9f340ac345d73b8fb04d2b349b
child 115521 739f8aac68a6ba0a57d9dfc2b45630fd300d9e57
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewerscjones
bugs796182
milestone18.0a1
Bug 796182; fix invalidation on Mac with OMTC; r=cjones
gfx/layers/basic/BasicThebesLayer.cpp
gfx/layers/basic/BasicThebesLayer.h
--- a/gfx/layers/basic/BasicThebesLayer.cpp
+++ b/gfx/layers/basic/BasicThebesLayer.cpp
@@ -325,17 +325,24 @@ BasicShadowableThebesLayer::SetBackBuffe
   } else {
     mBackBuffer = aBuffer.get_ThebesBuffer().buffer();
     mBackBufferRect = aBuffer.get_ThebesBuffer().rect();
     mBackBufferRectRotation = aBuffer.get_ThebesBuffer().rotation();
   }
   mFrontAndBackBufferDiffer = true;
   mROFrontBuffer = aReadOnlyFrontBuffer;
   mFrontUpdatedRegion = aFrontUpdatedRegion;
-  mFrontValidRegion = aValidRegion;
+
+  if (OptionalThebesBuffer::Tnull_t == mROFrontBuffer.type()) {
+    // We didn't get back a read-only ref to our old back buffer (the
+    // parent's new front buffer).  If the parent is pushing updates
+    // to a texture it owns, then we probably got back the same buffer
+    // we pushed in the update and all is well.  If not, ...
+    mValidRegion = aValidRegion;
+  }
 }
 
 void
 BasicShadowableThebesLayer::SyncFrontBufferToBackBuffer()
 {
   if (!mFrontAndBackBufferDiffer) {
     return;
   }
@@ -355,21 +362,16 @@ BasicShadowableThebesLayer::SyncFrontBuf
   }
   mFrontAndBackBufferDiffer = false;
 
   if (!backBuffer) {
     backBuffer = mBufferTracker->GetInitialBuffer();
   }
 
   if (OptionalThebesBuffer::Tnull_t == mROFrontBuffer.type()) {
-    // We didn't get back a read-only ref to our old back buffer (the
-    // parent's new front buffer).  If the parent is pushing updates
-    // to a texture it owns, then we probably got back the same buffer
-    // we pushed in the update and all is well.  If not, ...
-    mValidRegion = mFrontValidRegion;
     mBuffer.SetBackingBuffer(backBuffer, mBackBufferRect, mBackBufferRectRotation);
     return;
   }
 
   MOZ_LAYERS_LOG(("BasicShadowableThebes(%p): reading back <x=%d,y=%d,w=%d,h=%d>",
                   this,
                   mFrontUpdatedRegion.GetBounds().x,
                   mFrontUpdatedRegion.GetBounds().y,
--- a/gfx/layers/basic/BasicThebesLayer.h
+++ b/gfx/layers/basic/BasicThebesLayer.h
@@ -186,16 +186,15 @@ private:
   // keeps track of buffers we might have mapped and/or allocated.
   // When it goes out of scope on the stack, it unmaps whichever
   // buffers have been mapped (if any).
   AutoBufferTracker* mBufferTracker;
 
   bool mIsNewBuffer;
   OptionalThebesBuffer mROFrontBuffer;
   nsIntRegion mFrontUpdatedRegion;
-  nsIntRegion mFrontValidRegion;
   bool mFrontAndBackBufferDiffer;
 };
 
 }
 }
 
 #endif