Bug 1448439 - Rename AndroidFlingAnimation to StackScrollerFlingAnimation. r=kats
authorBotond Ballo <botond@mozilla.com>
Tue, 17 Apr 2018 19:56:48 -0400
changeset 415944 4c88aea1d5d04680ce5264d9dbeff170670c0b0d
parent 415943 aa70fd0d1b3cb7232c3146ddf32e4d211c5d4817
child 415945 11540b54a580de5f4bd2d262ed038ccb1ffb6e5e
push id33911
push usercsabou@mozilla.com
push dateFri, 27 Apr 2018 10:01:39 +0000
treeherdermozilla-central@822936017145 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1448439
milestone61.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 1448439 - Rename AndroidFlingAnimation to StackScrollerFlingAnimation. r=kats MozReview-Commit-ID: IdvOWYvE9Tr
gfx/layers/apz/src/AndroidAPZ.cpp
gfx/layers/apz/src/AndroidAPZ.h
gfx/layers/apz/src/AsyncPanZoomController.h
--- a/gfx/layers/apz/src/AndroidAPZ.cpp
+++ b/gfx/layers/apz/src/AndroidAPZ.cpp
@@ -41,17 +41,17 @@ AndroidSpecificState::AndroidSpecificSta
     return;
   }
   mOverScroller = scroller;
 }
 
 AsyncPanZoomAnimation*
 AndroidSpecificState::CreateFlingAnimation(AsyncPanZoomController& aApzc,
                                            const FlingHandoffState& aHandoffState) {
-  return new AndroidFlingAnimation(aApzc,
+  return new StackScrollerFlingAnimation(aApzc,
       this,
       aHandoffState.mChain,
       aHandoffState.mIsHandoff,
       aHandoffState.mScrolledApzc);
 }
 
 
 const float BOUNDS_EPSILON = 1.0f;
@@ -73,21 +73,21 @@ ClampStart(float aOrigin, float aMin, fl
   if (aOrigin <= aMin) {
     return (int32_t)floor(aMin);
   } else if (aOrigin >= aMax) {
     return (int32_t)ceil(aMax);
   }
   return (int32_t)aOrigin;
 }
 
-AndroidFlingAnimation::AndroidFlingAnimation(AsyncPanZoomController& aApzc,
-                                             PlatformSpecificStateBase* aPlatformSpecificState,
-                                             const RefPtr<const OverscrollHandoffChain>& aOverscrollHandoffChain,
-                                             bool aFlingIsHandoff,
-                                             const RefPtr<const AsyncPanZoomController>& aScrolledApzc)
+StackScrollerFlingAnimation::StackScrollerFlingAnimation(AsyncPanZoomController& aApzc,
+                                                         PlatformSpecificStateBase* aPlatformSpecificState,
+                                                         const RefPtr<const OverscrollHandoffChain>& aOverscrollHandoffChain,
+                                                         bool aFlingIsHandoff,
+                                                         const RefPtr<const AsyncPanZoomController>& aScrolledApzc)
   : mApzc(aApzc)
   , mOverscrollHandoffChain(aOverscrollHandoffChain)
   , mScrolledApzc(aScrolledApzc)
   , mSentBounceX(false)
   , mSentBounceY(false)
   , mFlingDuration(0)
 {
   MOZ_ASSERT(mOverscrollHandoffChain);
@@ -155,17 +155,17 @@ AndroidFlingAnimation::AndroidFlingAnima
 
 /**
  * Advances a fling by an interpolated amount based on the Android OverScroller.
  * This should be called whenever sampling the content transform for this
  * frame. Returns true if the fling animation should be advanced by one frame,
  * or false if there is no fling or the fling has ended.
  */
 bool
-AndroidFlingAnimation::DoSample(FrameMetrics& aFrameMetrics,
+StackScrollerFlingAnimation::DoSample(FrameMetrics& aFrameMetrics,
                                 const TimeDuration& aDelta)
 {
   bool shouldContinueFling = true;
 
   mFlingDuration += aDelta.ToMilliseconds();
   mOverScroller->ComputeScrollOffset(mFlingDuration, &shouldContinueFling);
 
   int32_t currentX = 0;
@@ -246,32 +246,32 @@ AndroidFlingAnimation::DoSample(FrameMet
       DeferHandleFlingOverscroll(bounceVelocity);
     }
   }
 
   return true;
 }
 
 void
-AndroidFlingAnimation::DeferHandleFlingOverscroll(ParentLayerPoint& aVelocity)
+StackScrollerFlingAnimation::DeferHandleFlingOverscroll(ParentLayerPoint& aVelocity)
 {
   mDeferredTasks.AppendElement(
       NewRunnableMethod<ParentLayerPoint,
                         RefPtr<const OverscrollHandoffChain>,
                         RefPtr<const AsyncPanZoomController>>("layers::AsyncPanZoomController::HandleFlingOverscroll",
                                                               &mApzc,
                                                               &AsyncPanZoomController::HandleFlingOverscroll,
                                                               aVelocity,
                                                               mOverscrollHandoffChain,
                                                               mScrolledApzc));
 
 }
 
 bool
-AndroidFlingAnimation::CheckBounds(Axis& aAxis, float aValue, float aDirection, float* aClamped)
+StackScrollerFlingAnimation::CheckBounds(Axis& aAxis, float aValue, float aDirection, float* aClamped)
 {
   if ((aDirection < 0.0f) && (aValue <= aAxis.GetPageStart().value)) {
     if (aClamped) {
       *aClamped = aAxis.GetPageStart().value;
     }
     return true;
   } else if ((aDirection > 0.0f) && (aValue >= aAxis.GetScrollRangeEnd().value)) {
     if (aClamped) {
--- a/gfx/layers/apz/src/AndroidAPZ.h
+++ b/gfx/layers/apz/src/AndroidAPZ.h
@@ -24,23 +24,23 @@ public:
 
   virtual AsyncPanZoomAnimation* CreateFlingAnimation(AsyncPanZoomController& aApzc,
                                                       const FlingHandoffState& aHandoffState) override;
 
   java::StackScroller::GlobalRef mOverScroller;
   TimeStamp mLastFling;
 };
 
-class AndroidFlingAnimation: public AsyncPanZoomAnimation {
+class StackScrollerFlingAnimation: public AsyncPanZoomAnimation {
 public:
-  AndroidFlingAnimation(AsyncPanZoomController& aApzc,
-                        PlatformSpecificStateBase* aPlatformSpecificState,
-                        const RefPtr<const OverscrollHandoffChain>& aOverscrollHandoffChain,
-                        bool aFlingIsHandoff /* ignored */,
-                        const RefPtr<const AsyncPanZoomController>& aScrolledApzc);
+  StackScrollerFlingAnimation(AsyncPanZoomController& aApzc,
+                              PlatformSpecificStateBase* aPlatformSpecificState,
+                              const RefPtr<const OverscrollHandoffChain>& aOverscrollHandoffChain,
+                              bool aFlingIsHandoff /* ignored */,
+                              const RefPtr<const AsyncPanZoomController>& aScrolledApzc);
   virtual bool DoSample(FrameMetrics& aFrameMetrics,
                         const TimeDuration& aDelta) override;
 private:
   void DeferHandleFlingOverscroll(ParentLayerPoint& aVelocity);
   // Returns true if value is on or outside of axis bounds.
   bool CheckBounds(Axis& aAxis, float aValue, float aDirection, float* aClamped);
 
   AsyncPanZoomController& mApzc;
--- a/gfx/layers/apz/src/AsyncPanZoomController.h
+++ b/gfx/layers/apz/src/AsyncPanZoomController.h
@@ -43,17 +43,17 @@ namespace layers {
 class AsyncDragMetrics;
 class APZCTreeManager;
 struct ScrollableLayerGuid;
 class CompositorController;
 class MetricsSharingController;
 class GestureEventListener;
 struct AsyncTransform;
 class AsyncPanZoomAnimation;
-class AndroidFlingAnimation;
+class StackScrollerFlingAnimation;
 class GenericFlingAnimation;
 class InputBlockState;
 struct FlingHandoffState;
 class TouchBlockState;
 class PanGestureBlockState;
 class OverscrollHandoffChain;
 struct OverscrollHandoffState;
 class StateChangeNotificationBlocker;
@@ -1155,17 +1155,17 @@ public:
    * Returns the "residual velocity", i.e. the portion of
    * |aHandoffState.mVelocity| that this APZC did not consume.
    */
   ParentLayerPoint AttemptFling(const FlingHandoffState& aHandoffState);
 
   ParentLayerPoint AdjustHandoffVelocityForOverscrollBehavior(ParentLayerPoint& aHandoffVelocity) const;
 
 private:
-  friend class AndroidFlingAnimation;
+  friend class StackScrollerFlingAnimation;
   friend class AutoscrollAnimation;
   friend class GenericFlingAnimation;
   friend class OverscrollAnimation;
   friend class SmoothScrollAnimation;
   friend class GenericScrollAnimation;
   friend class WheelScrollAnimation;
   friend class KeyboardScrollAnimation;