summaryrefslogtreecommitdiff
path: root/include/input/Resampler.h
diff options
context:
space:
mode:
author Paul Ramirez <peramirez@google.com> 2024-10-01 01:17:39 +0000
committer Paul Ramirez <peramirez@google.com> 2024-10-09 00:58:10 +0000
commit4679e55027a36e63cfdc642de313cb2c46c58c54 (patch)
tree91aca7153c9f7d2c1ef305717efa259488eae757 /include/input/Resampler.h
parent4d3b03adfa3543158c982546f3d6daec7eed06e8 (diff)
Add logic to overwrite pointer coordinates if event time is too old
Included OldEventReceivedAfterResampleOccurs from TouchResampling_test.cpp, and added the missing logic in LegacyResampler to pass the test. The CL wrongly assumes pointer information guarantees between motion events, that is, pointer IDs can appear in different order between samples. This issue is fixed in the second to last CL in the relation chain by using an associative array as a data structure to store and access pointer properties and coordinates. Bug: 297226446 Flag: EXEMPT refactor Test: TEST=libinput_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST --gtest_filter="InputConsumerResamplingTest*" Change-Id: I41cb79eaba965cfdfe7db68c388cb5d0ffa406f3
Diffstat (limited to 'include/input/Resampler.h')
-rw-r--r--include/input/Resampler.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/input/Resampler.h b/include/input/Resampler.h
index f04dfde995..47519c2cfd 100644
--- a/include/input/Resampler.h
+++ b/include/input/Resampler.h
@@ -166,6 +166,12 @@ private:
*/
void overwriteStillPointers(MotionEvent& motionEvent, size_t sampleIndex) const;
+ /**
+ * Overwrites the pointer coordinates of a sample with event time older than
+ * that of mPreviousPrediction.
+ */
+ void overwriteOldPointers(MotionEvent& motionEvent, size_t sampleIndex) const;
+
inline static void addSampleToMotionEvent(const Sample& sample, MotionEvent& motionEvent);
};
} // namespace android