summaryrefslogtreecommitdiff
path: root/libs/androidfw/Input.cpp
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2012-05-14 17:00:27 -0700
committer Jeff Brown <jeffbrown@google.com> 2012-05-14 18:31:53 -0700
commit7174a491bc1f89da65eaef3be25f3ea3f3e3bab5 (patch)
tree2171b655c03b965e92a68889ff5bdfea6da10757 /libs/androidfw/Input.cpp
parent85bd0d62830a098c1bdc720dfdcf4fe1b18b657c (diff)
Improve touch event resampling.
Fixed a few bugs related to the id-to-index mapping for pointer coordinates. Tightened the bounds on the resampling time interval to avoid predicting too far into the future. Only lerp X and Y components of motion events. Alter the future to satisfy past predictions. (Rewrite touch events to conceal obvious discontinuities.) Added a system property to control whether resampling is enabled for debugging purposes. Bug: 6375101 Change-Id: I35972d63278bc4e78148053a4125ad9abeebfedb
Diffstat (limited to 'libs/androidfw/Input.cpp')
-rw-r--r--libs/androidfw/Input.cpp20
1 files changed, 0 insertions, 20 deletions
diff --git a/libs/androidfw/Input.cpp b/libs/androidfw/Input.cpp
index 40a6c47d031f..97b0ec127b59 100644
--- a/libs/androidfw/Input.cpp
+++ b/libs/androidfw/Input.cpp
@@ -211,26 +211,6 @@ void PointerCoords::scale(float scaleFactor) {
scaleAxisValue(*this, AMOTION_EVENT_AXIS_TOOL_MINOR, scaleFactor);
}
-void PointerCoords::lerp(const PointerCoords& a, const PointerCoords& b, float alpha) {
- bits = 0;
- for (uint64_t bitsRemaining = a.bits | b.bits; bitsRemaining; ) {
- int32_t axis = __builtin_ctz(bitsRemaining);
- uint64_t axisBit = 1LL << axis;
- bitsRemaining &= ~axisBit;
- if (a.bits & axisBit) {
- if (b.bits & axisBit) {
- float aval = a.getAxisValue(axis);
- float bval = b.getAxisValue(axis);
- setAxisValue(axis, aval + alpha * (bval - aval));
- } else {
- setAxisValue(axis, a.getAxisValue(axis));
- }
- } else {
- setAxisValue(axis, b.getAxisValue(axis));
- }
- }
-}
-
#ifdef HAVE_ANDROID_OS
status_t PointerCoords::readFromParcel(Parcel* parcel) {
bits = parcel->readInt64();