Remove unneeded code from SmoothScrollAnimation. (bug 1139220 part 4, r=kats)
authorDavid Anderson <danderson@mozilla.com>
Wed, 01 Apr 2015 23:43:20 -0700
changeset 237522 e34a66a053da001113b866919fc51b5c7d1345f5
parent 237521 c4f3a3a15b3b3c3b440f8934c6960aaa12139dc0
child 237523 5c982f0795decc99890aac978217f4216b23745c
push id57962
push userdanderson@mozilla.com
push dateFri, 03 Apr 2015 05:40:15 +0000
treeherdermozilla-inbound@5c982f0795de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1139220
milestone40.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
Remove unneeded code from SmoothScrollAnimation. (bug 1139220 part 4, r=kats)
gfx/layers/apz/src/AsyncPanZoomController.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -678,22 +678,17 @@ public:
                         double aDampingRatio)
    : AsyncPanZoomAnimation(TimeDuration::FromMilliseconds(
                            gfxPrefs::APZSmoothScrollRepaintInterval()))
    , mApzc(aApzc)
    , mXAxisModel(aInitialPosition.x, aDestination.x, aInitialVelocity.x,
                  aSpringConstant, aDampingRatio)
    , mYAxisModel(aInitialPosition.y, aDestination.y, aInitialVelocity.y,
                  aSpringConstant, aDampingRatio)
-   , mSource(aSource)
-   , mAllowOverscroll(true)
   {
-    if (mSource == ScrollSource::Wheel) {
-      mAllowOverscroll = mApzc.AllowScrollHandoffInWheelTransaction();
-    }
   }
 
   /**
    * Advances a smooth scroll simulation based on the time passed in |aDelta|.
    * This should be called whenever sampling the content transform for this
    * frame. Returns true if the smooth scroll should be advanced by one frame,
    * or false if the smooth scroll has ended.
    */
@@ -728,29 +723,25 @@ public:
     // If we overscroll, hand off to a fling animation that will complete the
     // spring back.
     CSSToParentLayerScale2D zoom = aFrameMetrics.GetZoom();
     ParentLayerPoint displacement = (position - aFrameMetrics.GetScrollOffset()) * zoom;
 
     ParentLayerPoint overscroll;
     ParentLayerPoint adjustedOffset;
     mApzc.mX.AdjustDisplacement(displacement.x, adjustedOffset.x, overscroll.x);
-
-    bool forceVerticalOverscroll = mSource == ScrollSource::Wheel &&
-                                   !aFrameMetrics.AllowVerticalScrollWithWheel();
-    mApzc.mY.AdjustDisplacement(displacement.y, adjustedOffset.y, overscroll.y,
-                                forceVerticalOverscroll);
+    mApzc.mY.AdjustDisplacement(displacement.y, adjustedOffset.y, overscroll.y);
 
     aFrameMetrics.ScrollBy(adjustedOffset / zoom);
 
     // The smooth scroll may have caused us to reach the end of our scroll range.
     // This can happen if either the layout.css.scroll-behavior.damping-ratio
     // preference is set to less than 1 (underdamped) or if a smooth scroll
     // inherits velocity from a fling gesture.
-    if (!IsZero(overscroll) && mAllowOverscroll) {
+    if (!IsZero(overscroll)) {
       // Hand off a fling with the remaining momentum to the next APZC in the
       // overscroll handoff chain.
 
       // We may have reached the end of the scroll range along one axis but
       // not the other. In such a case we only want to hand off the relevant
       // component of the fling.
       if (FuzzyEqualsAdditive(overscroll.x, 0.0f, COORDINATE_EPSILON)) {
         velocity.x = 0;
@@ -777,18 +768,16 @@ public:
       return false;
     }
 
     return true;
   }
 private:
   AsyncPanZoomController& mApzc;
   AxisPhysicsMSDModel mXAxisModel, mYAxisModel;
-  ScrollSource mSource;
-  bool mAllowOverscroll;
 };
 
 void
 AsyncPanZoomController::SetFrameTime(const TimeStamp& aTime) {
   sFrameTime = aTime;
 }
 
 /*static*/ void