Bug 842389 - return the right thing from ProgressiveUpdate; r=cwiiis
authorNicholas Cameron <ncameron@mozilla.com>
Thu, 07 Mar 2013 15:02:06 +0000
changeset 124118 9c58cb6c3b860813fb303a02775108be23a16dca
parent 124117 ed4682d0df21d2338e9dec72e5b280fc8cfb1c09
child 124119 34884eaeb75b64e2281690d8d01994328895eb96
push id24408
push userryanvm@gmail.com
push dateFri, 08 Mar 2013 04:58:11 +0000
treeherdermozilla-central@cb432984d5ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscwiiis
bugs842389
milestone22.0a1
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 842389 - return the right thing from ProgressiveUpdate; r=cwiiis
gfx/layers/basic/BasicTiledThebesLayer.cpp
--- a/gfx/layers/basic/BasicTiledThebesLayer.cpp
+++ b/gfx/layers/basic/BasicTiledThebesLayer.cpp
@@ -415,55 +415,55 @@ BasicTiledThebesLayer::ProgressiveUpdate
                                          const gfx3DMatrix& aTransform,
                                          const nsIntRect& aCompositionBounds,
                                          const gfx::Point& aScrollOffset,
                                          const gfxSize& aResolution,
                                          LayerManager::DrawThebesLayerCallback aCallback,
                                          void* aCallbackData)
 {
   bool repeat = false;
+  bool isBufferChanged = false;
   do {
     // Compute the region that should be updated. Repeat as many times as
     // is required.
     nsIntRegion regionToPaint;
     repeat = ComputeProgressiveUpdateRegion(aTiledBuffer,
                                             aInvalidRegion,
                                             aOldValidRegion,
                                             regionToPaint,
                                             aTransform,
                                             aCompositionBounds,
                                             aScrollOffset,
                                             aResolution,
                                             repeat);
 
-    // There's no further work to be done, return if nothing has been
-    // drawn, or give what has been drawn to the shadow layer to upload.
+    // There's no further work to be done.
     if (regionToPaint.IsEmpty()) {
-      if (repeat) {
-        break;
-      } else {
-        return false;
-      }
+      break;
     }
 
+    isBufferChanged |= true;
+
     // Keep track of what we're about to refresh.
     aValidRegion.Or(aValidRegion, regionToPaint);
 
     // aValidRegion may have been altered by InvalidateRegion, but we still
     // want to display stale content until it gets progressively updated.
     // Create a region that includes stale content.
     nsIntRegion validOrStale;
     validOrStale.Or(aValidRegion, aOldValidRegion);
 
     // Paint the computed region and subtract it from the invalid region.
     aTiledBuffer.PaintThebes(this, validOrStale, regionToPaint, aCallback, aCallbackData);
     aInvalidRegion.Sub(aInvalidRegion, regionToPaint);
   } while (repeat);
 
-  return true;
+  // Return false if nothing has been drawn, or give what has been drawn
+  // to the shadow layer to upload.
+  return isBufferChanged;
 }
 
 void
 BasicTiledThebesLayer::BeginPaint()
 {
   if (BasicManager()->IsRepeatTransaction()) {
     return;
   }