Bug 1027851 - Add some more logging for when we abort paints. r=Cwiiis a=2.0+
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 03 Jul 2014 18:26:03 -0400
changeset 208832 cfd8acd59ca204ef0b0acb700268951a67adb1a7
parent 208831 b8dfb6b7b99a6fa1953b2caf66336e0cff816a60
child 208833 38be883fd6a67dbdbca600dbbb11e90d7e89137b
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, 2
bugs1027851
milestone32.0a2
Bug 1027851 - Add some more logging for when we abort paints. r=Cwiiis a=2.0+
gfx/layers/client/TiledContentClient.cpp
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -183,25 +183,28 @@ SharedFrameMetricsHelper::UpdateFromComp
 
   aViewTransform = ComputeViewTransform(contentMetrics, compositorMetrics);
 
   // Reset the checkerboard risk flag when switching to low precision
   // rendering.
   if (aLowPrecision && !mLastProgressiveUpdateWasLowPrecision) {
     // Skip low precision rendering until we're at risk of checkerboarding.
     if (!mProgressiveUpdateWasInDanger) {
+      TILING_PRLOG(("TILING: Aborting low-precision rendering because not at risk of checkerboarding\n"));
       return true;
     }
     mProgressiveUpdateWasInDanger = false;
   }
   mLastProgressiveUpdateWasLowPrecision = aLowPrecision;
 
   // Always abort updates if the resolution has changed. There's no use
   // in drawing at the incorrect resolution.
   if (!FuzzyEquals(compositorMetrics.GetZoom().scale, contentMetrics.GetZoom().scale)) {
+    TILING_PRLOG(("TILING: Aborting because resolution changed from %f to %f\n",
+        contentMetrics.GetZoom().scale, compositorMetrics.GetZoom().scale));
     return true;
   }
 
   // Never abort drawing if we can't be sure we've sent a more recent
   // display-port. If we abort updating when we shouldn't, we can end up
   // with blank regions on the screen and we open up the risk of entering
   // an endless updating cycle.
   if (fabsf(contentMetrics.GetScrollOffset().x - compositorMetrics.GetScrollOffset().x) <= 2 &&
@@ -230,16 +233,17 @@ SharedFrameMetricsHelper::UpdateFromComp
       mProgressiveUpdateWasInDanger = true;
       return true;
     }
   }
 
   // Abort drawing stale low-precision content if there's a more recent
   // display-port in the pipeline.
   if (aLowPrecision && !aHasPendingNewThebesContent) {
+    TILING_PRLOG(("TILING: Aborting low-precision because of new pending content\n"));
     return true;
   }
 
   return false;
 }
 
 bool
 SharedFrameMetricsHelper::AboutToCheckerboard(const FrameMetrics& aContentMetrics,
@@ -263,17 +267,24 @@ SharedFrameMetricsHelper::AboutToChecker
                   / aCompositorMetrics.LayersPixelsPerCSSPixel());
 
   // Clamp both rects to the scrollable rect, because having either of those
   // exceed the scrollable rect doesn't make sense, and could lead to false
   // positives.
   painted = painted.Intersect(aContentMetrics.mScrollableRect);
   showing = showing.Intersect(aContentMetrics.mScrollableRect);
 
-  return !painted.Contains(showing);
+  if (!painted.Contains(showing)) {
+    TILING_PRLOG_OBJ(("TILING: About to checkerboard; content %s\n", tmpstr.get()), aContentMetrics);
+    TILING_PRLOG_OBJ(("TILING: About to checkerboard; painted %s\n", tmpstr.get()), painted);
+    TILING_PRLOG_OBJ(("TILING: About to checkerboard; compositor %s\n", tmpstr.get()), aCompositorMetrics);
+    TILING_PRLOG_OBJ(("TILING: About to checkerboard; showing %s\n", tmpstr.get()), showing);
+    return true;
+  }
+  return false;
 }
 
 ClientTiledLayerBuffer::ClientTiledLayerBuffer(ClientTiledThebesLayer* aThebesLayer,
                                              CompositableClient* aCompositableClient,
                                              ClientLayerManager* aManager,
                                              SharedFrameMetricsHelper* aHelper)
   : mThebesLayer(aThebesLayer)
   , mCompositableClient(aCompositableClient)