summaryrefslogtreecommitdiff
path: root/include/input/Resampler.h
diff options
context:
space:
mode:
author Paul Ramirez <peramirez@google.com> 2024-09-29 23:55:23 +0000
committer Paul Ramirez <peramirez@google.com> 2024-10-06 23:11:33 +0000
commit7f1efed1f8fcae76c021bfcea244c4f92844a608 (patch)
tree25382ef1de8c8d21492436587d7c2567747a4411 /include/input/Resampler.h
parent5d59a429f0b0954f8183d4931db8417e308efca8 (diff)
Add check to not resample when resample time equals motion event time
Included SampleTimeEqualsEventTime from TouchResampling_test.cpp into InputConsumerResampling_test.cpp, and added the missing logic in LegacyResampler to pass the test. Bug: 297226446 Flag: EXEMPT refactor Test: TEST=libinput_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST --gtest_filter="InputConsumerResamplingTest*" Change-Id: I8ff9a263ea79eed1b814d2b1ce0b7efb5ade584e
Diffstat (limited to 'include/input/Resampler.h')
-rw-r--r--include/input/Resampler.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/input/Resampler.h b/include/input/Resampler.h
index 4aaeddd159..da0c5b2150 100644
--- a/include/input/Resampler.h
+++ b/include/input/Resampler.h
@@ -65,7 +65,8 @@ public:
* extrapolation takes place and `resampleTime` is too far in the future. If `futureSample` is
* not null, interpolation will occur. If `futureSample` is null and there is enough historical
* data, LegacyResampler will extrapolate. Otherwise, no resampling takes place and
- * `motionEvent` is unmodified.
+ * `motionEvent` is unmodified. Furthermore, motionEvent is not resampled if resampleTime equals
+ * the last sample eventTime of motionEvent.
*/
void resampleMotionEvent(std::chrono::nanoseconds frameTime, MotionEvent& motionEvent,
const InputMessage* futureSample) override;