Bug 916379 - Remove a content repaint request that was clobbering the right frame metrics with the wrong one. r=BenWa, a=koi+
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 30 Sep 2013 20:58:36 -0400
changeset 160531 844587e80414f1442cd3663aa3e9db9a473b38e6
parent 160530 eb1b2309837f84503c899be922f0a2d2ca4f3c5d
child 160532 3eeec6a3090d56cea4ce0e3299367c363fb7b2a5
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa, koi
bugs916379
milestone26.0a2
Bug 916379 - Remove a content repaint request that was clobbering the right frame metrics with the wrong one. r=BenWa, a=koi+
gfx/layers/ipc/AsyncPanZoomController.cpp
gfx/tests/gtest/TestAsyncPanZoomController.cpp
--- a/gfx/layers/ipc/AsyncPanZoomController.cpp
+++ b/gfx/layers/ipc/AsyncPanZoomController.cpp
@@ -1178,21 +1178,16 @@ void AsyncPanZoomController::NotifyLayer
 
   if (aIsFirstPaint || isDefault) {
     mPaintThrottler.ClearHistory();
     mPaintThrottler.SetMaxDurations(gNumPaintDurationSamples);
 
     mX.CancelTouch();
     mY.CancelTouch();
 
-    // XXX If this is the very first time we're getting a layers update we need to
-    // trigger another repaint, or the B2G browser shows stale content. This needs
-    // to be investigated and fixed.
-    needContentRepaint |= (isDefault && !aLayerMetrics.IsDefault());
-
     mFrameMetrics = aLayerMetrics;
     mState = NOTHING;
   } else if (!mFrameMetrics.mScrollableRect.IsEqualEdges(aLayerMetrics.mScrollableRect)) {
     mFrameMetrics.mScrollableRect = aLayerMetrics.mScrollableRect;
   }
 
   if (needContentRepaint) {
     RequestContentRepaint();
--- a/gfx/tests/gtest/TestAsyncPanZoomController.cpp
+++ b/gfx/tests/gtest/TestAsyncPanZoomController.cpp
@@ -356,21 +356,16 @@ SetScrollableFrameMetrics(Layer* aLayer,
   FrameMetrics metrics;
   metrics.mScrollId = aScrollId;
   nsIntRect layerBound = aLayer->GetVisibleRegion().GetBounds();
   metrics.mCompositionBounds = ScreenIntRect(layerBound.x, layerBound.y,
                                              layerBound.width, layerBound.height);
   metrics.mViewport = CSSRect(layerBound.x, layerBound.y,
                               layerBound.width, layerBound.height);
   container->SetFrameMetrics(metrics);
-
-  // when we do the next tree update, a new APZC will be created for this layer,
-  // and that will invoke these functions once.
-  EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(1);
-  EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1);
 }
 
 static gfxPoint
 NudgeToIntegers(const gfxPoint& aPoint)
 {
   // gfxPoint has doubles but NudgeToInteger takes
   // floats so use local vars. The loss in precision
   // shouldn't affect this because these are supposed