diff options
author | Michael Wright <michaelwr@google.com> | 2013-10-21 17:30:25 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-21 17:30:25 -0700 |
commit | 2130192c78d872e2c605648e6eadde8ff655463d (patch) | |
tree | 39ecfb853edfeed5653f00e3854c0129e8cd26e0 /libs/input | |
parent | 60f19de1ed0bf5f19c07a3c66d3267fe4f96b907 (diff) | |
parent | 47f0b9894b78a76a1257e0f3299cbe5446035c09 (diff) | |
download | frameworks_native-2130192c78d872e2c605648e6eadde8ff655463d.zip frameworks_native-2130192c78d872e2c605648e6eadde8ff655463d.tar.gz frameworks_native-2130192c78d872e2c605648e6eadde8ff655463d.tar.bz2 |
am 47f0b989: am 3223217a: Only consume touches up until the frame time
* commit '47f0b9894b78a76a1257e0f3299cbe5446035c09':
Only consume touches up until the frame time
Diffstat (limited to 'libs/input')
-rw-r--r-- | libs/input/InputTransport.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/input/InputTransport.cpp b/libs/input/InputTransport.cpp index 9bd7fc6..09b2e7c 100644 --- a/libs/input/InputTransport.cpp +++ b/libs/input/InputTransport.cpp @@ -511,14 +511,17 @@ status_t InputConsumer::consumeBatch(InputEventFactoryInterface* factory, status_t result; for (size_t i = mBatches.size(); i-- > 0; ) { Batch& batch = mBatches.editItemAt(i); - if (frameTime < 0 || !mResampleTouch) { + if (frameTime < 0) { result = consumeSamples(factory, batch, batch.samples.size(), outSeq, outEvent); mBatches.removeAt(i); return result; } - nsecs_t sampleTime = frameTime - RESAMPLE_LATENCY; + nsecs_t sampleTime = frameTime; + if (mResampleTouch) { + sampleTime -= RESAMPLE_LATENCY; + } ssize_t split = findSampleNoLaterThan(batch, sampleTime); if (split < 0) { continue; @@ -532,7 +535,7 @@ status_t InputConsumer::consumeBatch(InputEventFactoryInterface* factory, } else { next = &batch.samples.itemAt(0); } - if (!result) { + if (!result && mResampleTouch) { resampleTouchState(sampleTime, static_cast<MotionEvent*>(*outEvent), next); } return result; |