diff options
author | 2024-09-13 23:01:12 +0000 | |
---|---|---|
committer | 2024-09-19 15:32:29 +0000 | |
commit | cd7488c13e2cc9b3f7cb7100812d353fe585fc07 (patch) | |
tree | f0bf392c1d9dfecc0e051db7567dd5b53ce29a0c /include/input/Resampler.h | |
parent | 322fb3b70d8151b984ed98b1909b9e0bd59e7601 (diff) |
Fix batching logic in InputConsumerNoResampling.cpp
Fixed batching logic in InputConsumerNoResampling.cpp because it was
violating resampling frameTime preconditions.
Bug: 297226446
Flag: EXEMPT bugfix
Test: TEST=libinput_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST --gtest_filter="InputConsumerTest*"
Change-Id: I1b658d5b9ac7a56a8a3917a49c2b97b60641c0d5
Diffstat (limited to 'include/input/Resampler.h')
-rw-r--r-- | include/input/Resampler.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/input/Resampler.h b/include/input/Resampler.h index 67d92bd3ad..dcb25b729f 100644 --- a/include/input/Resampler.h +++ b/include/input/Resampler.h @@ -47,6 +47,13 @@ struct Resampler { */ virtual void resampleMotionEvent(std::chrono::nanoseconds frameTime, MotionEvent& motionEvent, const InputMessage* futureSample) = 0; + + /** + * Returns resample latency. Resample latency is the time difference between frame time and + * resample time. More precisely, let frameTime and resampleTime be two timestamps, and + * frameTime > resampleTime. Resample latency is defined as frameTime - resampleTime. + */ + virtual std::chrono::nanoseconds getResampleLatency() const = 0; }; class LegacyResampler final : public Resampler { @@ -63,6 +70,8 @@ public: void resampleMotionEvent(std::chrono::nanoseconds frameTime, MotionEvent& motionEvent, const InputMessage* futureSample) override; + std::chrono::nanoseconds getResampleLatency() const override; + private: struct Pointer { PointerProperties properties; |