Bug 1304729 - Ensure we schedule a composite if we change the scroll position during a pinch gesture with no zoom change. r=botond draft
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 22 Sep 2016 14:53:56 -0400
changeset 417089 ab1718c770489431443ab0bc47ca46733524f018
parent 416020 560b2c805bf7bebeb3ceebc495a81b2aa4c0c755
child 417090 8f274c32c95659bdef97c3dd94dee4bfa0ae2e97
push id30332
push userkgupta@mozilla.com
push dateFri, 23 Sep 2016 16:03:26 +0000
reviewersbotond
bugs1304729
milestone52.0a1
Bug 1304729 - Ensure we schedule a composite if we change the scroll position during a pinch gesture with no zoom change. r=botond MozReview-Commit-ID: AF2aoJZ1ssG
gfx/layers/apz/src/AsyncPanZoomController.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -1389,18 +1389,16 @@ nsEventStatus AsyncPanZoomController::On
       neededDisplacement.y = -mY.ScaleWillOverscrollAmount(spanRatio, cssFocusPoint.y);
 
       ScaleWithFocus(spanRatio, cssFocusPoint);
 
       if (neededDisplacement != CSSPoint()) {
         ScrollBy(neededDisplacement);
       }
 
-      ScheduleComposite();
-
       // We don't want to redraw on every scale, so throttle it.
       if (!mPinchPaintTimerSet) {
         const int delay = gfxPrefs::APZScaleRepaintDelay();
         if (delay >= 0) {
           if (RefPtr<GeckoContentController> controller = GetGeckoContentController()) {
             mPinchPaintTimerSet = true;
             controller->PostDelayedTask(
               NewRunnableMethod(this,
@@ -1408,16 +1406,20 @@ nsEventStatus AsyncPanZoomController::On
               delay);
           }
         }
       }
 
       UpdateSharedCompositorFrameMetrics();
     }
 
+    // We did a ScrollBy call above even if we didn't do a scale, so we
+    // should composite for that.
+    ScheduleComposite();
+
     mLastZoomFocus = focusPoint;
   }
 
   return nsEventStatus_eConsumeNoDefault;
 }
 
 nsEventStatus AsyncPanZoomController::OnScaleEnd(const PinchGestureInput& aEvent) {
   APZC_LOG("%p got a scale-end in state %d\n", this, mState);