Bug 1498329 - Fix a bug in AndroidVelocityTracker::ComputeVelocity() where we were unintentionally ignoring the oldest data point. r=kats
authorBotond Ballo <botond@mozilla.com>
Mon, 15 Oct 2018 23:29:21 +0000
changeset 499823 b8d65158722104c789df029684d2081288ff6081
parent 499822 783ec708b98b02c22368ef1f1da587dbf6fe4294
child 499824 8ceb713af9c7f2b453f42c46bd9ffd8ae1aece44
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1498329
milestone64.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 1498329 - Fix a bug in AndroidVelocityTracker::ComputeVelocity() where we were unintentionally ignoring the oldest data point. r=kats Differential Revision: https://phabricator.services.mozilla.com/D8786
gfx/layers/apz/src/AndroidVelocityTracker.cpp
--- a/gfx/layers/apz/src/AndroidVelocityTracker.cpp
+++ b/gfx/layers/apz/src/AndroidVelocityTracker.cpp
@@ -274,17 +274,17 @@ AndroidVelocityTracker::ComputeVelocity(
       break;
 
     ParentLayerCoord position = movement.second;
     pos[m] = position;
     w[m] = 1.0f;
     time[m] = -static_cast<float>(age) / 1000.0f;  // in seconds
     index--;
     m++;
-  } while (index > 0);
+  } while (index >= 0);
 
   if (m == 0) {
     return velocity;  // no data
   }
 
   // Calculate a least squares polynomial fit.
 
   // Polynomial degree (number of coefficients), or zero if no information is