Bug 1280580 - Android native fling animation is returning an inverted velocity r=kats
authorRandall Barker <rbarker@mozilla.com>
Thu, 16 Jun 2016 16:40:28 +0100
changeset 302006 f97c058ecdeb29f13c3e1e01794cbfebd24ca815
parent 302005 feb0e93ac30db4ea9533a247f38d2505d45bef32
child 302007 a95a934791f7a2657896db7b626ac1bf95e2bc5b
push id78539
push userrbarker@mozilla.com
push dateFri, 17 Jun 2016 10:41:44 +0000
treeherdermozilla-inbound@f97c058ecdeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1280580
milestone50.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 1280580 - Android native fling animation is returning an inverted velocity r=kats
gfx/layers/apz/src/AndroidAPZ.cpp
--- a/gfx/layers/apz/src/AndroidAPZ.cpp
+++ b/gfx/layers/apz/src/AndroidAPZ.cpp
@@ -132,17 +132,17 @@ AndroidFlingAnimation::DoSample(FrameMet
   ParentLayerPoint velocity = mPreviousVelocity;
 
   // Sometimes the OverScroller fails to update the offset for a frame.
   // If the frame can still scroll we just use the velocity from the previous
   // frame. However, if the frame can no longer scroll in the direction
   // of the fling, then end the animation.
   if (offset != mPreviousOffset) {
     if (aDelta.ToMilliseconds() > 0) {
-      velocity = (mPreviousOffset - offset) / (float)aDelta.ToMilliseconds();
+      velocity = (offset - mPreviousOffset) / (float)aDelta.ToMilliseconds();
       mPreviousVelocity = velocity;
     }
   } else if (hitBoundX || hitBoundY) {
     // We have reached the end of the scroll in one of the directions being scrolled and the offset has not
     // changed so end animation.
     shouldContinueFling = false;
   }