Bug 1026756 - Detect when a scroll offset update is going to remove checkerboarding, and don't leave things in a low-precision state. r=Cwiiis
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 19 Jun 2014 09:27:31 -0400
changeset 189609 b776a7d35ba3c4a420d2fa0dc36212945667fd4e
parent 189608 5f1041f40876e91b7e00a5e895c53f455d19b914
child 189610 f17c906538c9cb7490b68f03b825e72413a8f960
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersCwiiis
bugs1026756
milestone33.0a1
Bug 1026756 - Detect when a scroll offset update is going to remove checkerboarding, and don't leave things in a low-precision state. r=Cwiiis
gfx/layers/client/TiledContentClient.cpp
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -203,17 +203,27 @@ SharedFrameMetricsHelper::UpdateFromComp
       fabsf(contentMetrics.mDisplayPort.width - compositorMetrics.mDisplayPort.width) <= 2 &&
       fabsf(contentMetrics.mDisplayPort.height - compositorMetrics.mDisplayPort.height)) {
     return false;
   }
 
   // When not a low precision pass and the page is in danger of checker boarding
   // abort update.
   if (!aLowPrecision && !mProgressiveUpdateWasInDanger) {
-    if (AboutToCheckerboard(contentMetrics, compositorMetrics)) {
+    bool scrollUpdatePending = contentMetrics.GetScrollOffsetUpdated() &&
+        contentMetrics.GetScrollGeneration() != compositorMetrics.GetScrollGeneration();
+    // If scrollUpdatePending is true, then that means the content-side
+    // metrics has a new scroll offset that is going to be forced into the
+    // compositor but it hasn't gotten there yet.
+    // Even though right now comparing the metrics might indicate we're
+    // about to checkerboard (and that's true), the checkerboarding will
+    // disappear as soon as the new scroll offset update is processed
+    // on the compositor side. To avoid leaving things in a low-precision
+    // paint, we need to detect and handle this case (bug 1026756).
+    if (!scrollUpdatePending && AboutToCheckerboard(contentMetrics, compositorMetrics)) {
       mProgressiveUpdateWasInDanger = true;
       return true;
     }
   }
 
   // Abort drawing stale low-precision content if there's a more recent
   // display-port in the pipeline.
   if (aLowPrecision && !aHasPendingNewThebesContent) {