Bug 1129632. Resample touch events based on the current touch. r=mwu
authorMason Chang <mchang@mozilla.com>
Wed, 04 Feb 2015 17:06:09 -0800
changeset 227536 4f1b69be79ddda8398d640e6bbd30f05cd5a43c7
parent 227535 ee41a05c47ee1f18e6cd736e462099e1912c6314
child 227537 2037891bcdc84fdacd7e9b93f1b9cedc5f73b804
push id28233
push usercbook@mozilla.com
push dateThu, 05 Feb 2015 13:22:30 +0000
treeherdermozilla-central@d2df44094059 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmwu
bugs1129632
milestone38.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 1129632. Resample touch events based on the current touch. r=mwu
widget/gonk/GeckoTouchDispatcher.cpp
--- a/widget/gonk/GeckoTouchDispatcher.cpp
+++ b/widget/gonk/GeckoTouchDispatcher.cpp
@@ -242,18 +242,18 @@ static void
 ResampleTouch(MultiTouchInput& aOutTouch,
               MultiTouchInput& aBase, MultiTouchInput& aCurrent,
               TimeDuration aFrameDiff, TimeDuration aTouchDiff)
 {
   aOutTouch = aCurrent;
 
   // Make sure we only resample the correct finger.
   for (size_t i = 0; i < aOutTouch.mTouches.Length(); i++) {
-    const SingleTouchData& base = aBase.mTouches[i];
-    const SingleTouchData& current = GetTouchByID(base, aCurrent);
+    const SingleTouchData& current = aCurrent.mTouches[i];
+    const SingleTouchData& base = GetTouchByID(current, aBase);
 
     const ScreenIntPoint& baseTouchPoint = base.mScreenPoint;
     const ScreenIntPoint& currentTouchPoint = current.mScreenPoint;
 
     ScreenIntPoint newSamplePoint;
     newSamplePoint.x = Interpolate(baseTouchPoint.x, currentTouchPoint.x, aFrameDiff, aTouchDiff);
     newSamplePoint.y = Interpolate(baseTouchPoint.y, currentTouchPoint.y, aFrameDiff, aTouchDiff);