Bug 842389 - Return the right thing from ProgressiveUpdate. r=cwiiis, a=lsblakk
authorNicholas Cameron <ncameron@mozilla.com>
Thu, 07 Mar 2013 15:02:06 +0000
changeset 132372 4e414cc5ca5a95f844e3821b8f9995240b4fee34
parent 132371 fae605ea8ef70bb7ae88006b7db3709c901c8e50
child 132373 4b062091ea4ea910e660d7545fdeb3c4e67f9b3a
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscwiiis, lsblakk
bugs842389
milestone21.0a2
Bug 842389 - Return the right thing from ProgressiveUpdate. r=cwiiis, a=lsblakk
gfx/layers/basic/BasicTiledThebesLayer.cpp
--- a/gfx/layers/basic/BasicTiledThebesLayer.cpp
+++ b/gfx/layers/basic/BasicTiledThebesLayer.cpp
@@ -416,55 +416,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;
   }