Bug 1021085 - Inflate the painted rect a bit to deal with rounding error. r=Cwiiis, a=2.0+
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 23 Jun 2014 08:42:19 -0400
changeset 207272 63f56d26a625498d1d74e4a684217173827b55e5
parent 207271 1d45ce23b1bbd76e1c2c38e011ed7f2cd275d979
child 207273 0d72bf6d5c3cc4248d3a1fb3eeba301bf457956f
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCwiiis, 2
bugs1021085
milestone32.0a2
Bug 1021085 - Inflate the painted rect a bit to deal with rounding error. r=Cwiiis, a=2.0+
gfx/layers/client/TiledContentClient.cpp
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -234,16 +234,19 @@ SharedFrameMetricsHelper::ComputeViewTra
 
 bool
 SharedFrameMetricsHelper::AboutToCheckerboard(const FrameMetrics& aContentMetrics,
                                               const FrameMetrics& aCompositorMetrics)
 {
   CSSRect painted =
         (aContentMetrics.mCriticalDisplayPort.IsEmpty() ? aContentMetrics.mDisplayPort : aContentMetrics.mCriticalDisplayPort)
         + aContentMetrics.GetScrollOffset();
+  // Inflate painted by some small epsilon to deal with rounding
+  // error. We should replace this with a FuzzyContains function.
+  painted.Inflate(0.01f);
   CSSRect showing = CSSRect(aCompositorMetrics.GetScrollOffset(), aCompositorMetrics.CalculateBoundedCompositedSizeInCssPixels());
   return !painted.Contains(showing);
 }
 
 ClientTiledLayerBuffer::ClientTiledLayerBuffer(ClientTiledThebesLayer* aThebesLayer,
                                              CompositableClient* aCompositableClient,
                                              ClientLayerManager* aManager,
                                              SharedFrameMetricsHelper* aHelper)