Bug 1023882 - Part 6 - Move all SetRepeatTransaction calls into ClientTiledThebesLayer so it's easier to follow the flow. r=Cwiiis
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 11 Jun 2014 12:42:45 -0400
changeset 208286 71229cd93bd6520900cd93ae40652d3915cfc37e
parent 208285 fa1f2e6b820b5e51ec1177d23a7b5741337b6077
child 208287 5c082ed1469bc89163a56462bb20a0d71292fe5f
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCwiiis
bugs1023882
milestone32.0a2
Bug 1023882 - Part 6 - Move all SetRepeatTransaction calls into ClientTiledThebesLayer so it's easier to follow the flow. r=Cwiiis
gfx/layers/client/ClientTiledThebesLayer.cpp
gfx/layers/client/TiledContentClient.cpp
--- a/gfx/layers/client/ClientTiledThebesLayer.cpp
+++ b/gfx/layers/client/ClientTiledThebesLayer.cpp
@@ -402,19 +402,26 @@ ClientTiledThebesLayer::RenderLayer()
 
   TILING_PRLOG_OBJ(("TILING 0x%p: Invalid region %s\n", this, tmpstr.get()), invalidRegion);
 
   bool updatedHighPrecision = RenderHighPrecision(invalidRegion, callback, data);
   if (updatedHighPrecision) {
     ClientManager()->Hold(this);
     mContentClient->UseTiledLayerBuffer(TiledContentClient::TILED_BUFFER);
 
+    if (!mPaintData.mPaintFinished) {
+      // There is still more high-res stuff to paint, so we're not
+      // done yet. A subsequent transaction will take care of this.
+      ClientManager()->SetRepeatTransaction();
+      return;
+    }
+
     // If there are low precision updates, mark the paint as unfinished and
     // request a repeat transaction.
-    if (!lowPrecisionInvalidRegion.IsEmpty() && mPaintData.mPaintFinished) {
+    if (!lowPrecisionInvalidRegion.IsEmpty()) {
       ClientManager()->SetRepeatTransaction();
       mPaintData.mLowPrecisionPaintCount = 1;
       mPaintData.mPaintFinished = false;
     }
 
     // Return so that low precision updates aren't performed in the same
     // transaction as high-precision updates.
     EndPaint(false);
@@ -423,15 +430,21 @@ ClientTiledThebesLayer::RenderLayer()
 
   TILING_PRLOG_OBJ(("TILING 0x%p: Low-precision valid region is %s\n", this, tmpstr.get()), mLowPrecisionValidRegion);
   TILING_PRLOG_OBJ(("TILING 0x%p: Low-precision invalid region is %s\n", this, tmpstr.get()), lowPrecisionInvalidRegion);
 
   bool updatedLowPrecision = RenderLowPrecision(lowPrecisionInvalidRegion, callback, data);
   if (updatedLowPrecision) {
     ClientManager()->Hold(this);
     mContentClient->UseTiledLayerBuffer(TiledContentClient::LOW_PRECISION_TILED_BUFFER);
+
+    if (!mPaintData.mPaintFinished) {
+      // There is still more low-res stuff to paint, so we're not
+      // done yet. A subsequent transaction will take care of this.
+      ClientManager()->SetRepeatTransaction();
+    }
   }
 
   EndPaint(false);
 }
 
 } // mozilla
 } // layers
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -1059,23 +1059,20 @@ ClientTiledLayerBuffer::ComputeProgressi
   if (!aRegionToPaint.Contains(aInvalidRegion)) {
     // The region needed to paint is larger then our progressive chunk size
     // therefore update what we want to paint and ask for a new paint transaction.
 
     // If we need to draw more than one tile to maintain coherency, make
     // sure it happens in the same transaction by requesting this work be
     // repeated immediately.
     // If this is unnecessary, the remaining work will be done tile-by-tile in
-    // subsequent transactions.
-    if (!drawingLowPrecision && paintInSingleTransaction) {
-      return true;
-    }
-
-    mManager->SetRepeatTransaction();
-    return false;
+    // subsequent transactions. The caller code is responsible for scheduling
+    // the subsequent transactions as long as we don't set the mPaintFinished
+    // flag to true.
+    return (!drawingLowPrecision && paintInSingleTransaction);
   }
 
   // We're not repeating painting and we've not requested a repeat transaction,
   // so the paint is finished. If there's still a separate low precision
   // paint to do, it will get marked as unfinished later.
   aPaintData->mPaintFinished = true;
   return false;
 }