Bug 964997 - When scrolling is disabled, don't apply the velocity transformations to the displayport. r=botond, a=1.3+
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 30 Jan 2014 13:37:06 -0500
changeset 175196 a312fdd5d6878da95c199a2f15c3f8517656a0cb
parent 175195 981f79a18d83bdd10e4d579e98f8549edace273b
child 175197 e19f79f6a19f8e5777a793246c4e23acb8f9355a
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond, 1
bugs964997
milestone28.0a2
Bug 964997 - When scrolling is disabled, don't apply the velocity transformations to the displayport. r=botond, a=1.3+
gfx/layers/ipc/AsyncPanZoomController.cpp
--- a/gfx/layers/ipc/AsyncPanZoomController.cpp
+++ b/gfx/layers/ipc/AsyncPanZoomController.cpp
@@ -1155,16 +1155,25 @@ const CSSRect AsyncPanZoomController::Ca
   // convert to milliseconds
   double estimatedPaintDurationMillis = aEstimatedPaintDuration * 1000;
 
   CSSRect compositionBounds = aFrameMetrics.CalculateCompositedRectInCssPixels();
   CSSPoint scrollOffset = aFrameMetrics.mScrollOffset;
   CSSRect displayPort(scrollOffset, compositionBounds.Size());
   CSSPoint velocity = aVelocity / aFrameMetrics.mZoom;
 
+  // If scrolling is disabled here then our actual velocity is going
+  // to be zero, so treat the displayport accordingly.
+  if (aFrameMetrics.GetDisableScrollingX()) {
+    velocity.x = 0;
+  }
+  if (aFrameMetrics.GetDisableScrollingY()) {
+    velocity.y = 0;
+  }
+
   // Enlarge the displayport along both axes depending on how fast we're moving
   // on that axis and how long it takes to paint. Apply some heuristics to try
   // to minimize checkerboarding.
   EnlargeDisplayPortAlongAxis(&(displayPort.x), &(displayPort.width),
     estimatedPaintDurationMillis, velocity.x,
     gXStationarySizeMultiplier, gXSkateSizeMultiplier);
   EnlargeDisplayPortAlongAxis(&(displayPort.y), &(displayPort.height),
     estimatedPaintDurationMillis, velocity.y,