Bug 964997 - When scrolling is disabled, don't apply the velocity transformations to the displayport. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 30 Jan 2014 13:37:06 -0500
changeset 182122 ebab9c016bdf78d9a30f61f3231f4fad238ab41e
parent 182121 15a8086a24317bbbda3854afc523b3ee3506d729
child 182123 c0ee7e3892050df4800eb9b420c057300573ee6e
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs964997
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 964997 - When scrolling is disabled, don't apply the velocity transformations to the displayport. r=botond
gfx/layers/ipc/AsyncPanZoomController.cpp
--- a/gfx/layers/ipc/AsyncPanZoomController.cpp
+++ b/gfx/layers/ipc/AsyncPanZoomController.cpp
@@ -1295,16 +1295,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,