diff options
author | Jeff Brown <jeffbrown@google.com> | 2012-06-03 22:46:07 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2012-06-04 12:34:03 -0700 |
commit | a5b0698231459ac5b54cf8e8952ac5c2b2b2198b (patch) | |
tree | cc91df96eaa76fe98969e40f9b4e9b4dd0babbd3 /include | |
parent | 18f329e9480fca75210bb7496e5b4bc987b4ad8f (diff) | |
download | frameworks_base-a5b0698231459ac5b54cf8e8952ac5c2b2b2198b.zip frameworks_base-a5b0698231459ac5b54cf8e8952ac5c2b2b2198b.tar.gz frameworks_base-a5b0698231459ac5b54cf8e8952ac5c2b2b2198b.tar.bz2 |
Implement a second order integrating VT strategy.
Bug: 6413587
Change-Id: I51bc7b8cbff22b10b728fc84ee15370e9984dd55
Diffstat (limited to 'include')
-rw-r--r-- | include/androidfw/VelocityTracker.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/androidfw/VelocityTracker.h b/include/androidfw/VelocityTracker.h index 262a51b..3e6436a 100644 --- a/include/androidfw/VelocityTracker.h +++ b/include/androidfw/VelocityTracker.h @@ -196,7 +196,8 @@ private: */ class IntegratingVelocityTrackerStrategy : public VelocityTrackerStrategy { public: - IntegratingVelocityTrackerStrategy(); + // Degree must be 1 or 2. + IntegratingVelocityTrackerStrategy(uint32_t degree); ~IntegratingVelocityTrackerStrategy(); virtual void clear(); @@ -209,18 +210,19 @@ private: // Current state estimate for a particular pointer. struct State { nsecs_t updateTime; - bool first; + uint32_t degree; - float xpos, xvel; - float ypos, yvel; + float xpos, xvel, xaccel; + float ypos, yvel, yaccel; }; + const uint32_t mDegree; BitSet32 mPointerIdBits; State mPointerState[MAX_POINTER_ID + 1]; - static void initState(State& state, nsecs_t eventTime, float xpos, float ypos); - static void updateState(State& state, nsecs_t eventTime, float xpos, float ypos); - static void populateEstimator(const State& state, VelocityTracker::Estimator* outEstimator); + void initState(State& state, nsecs_t eventTime, float xpos, float ypos) const; + void updateState(State& state, nsecs_t eventTime, float xpos, float ypos) const; + void populateEstimator(const State& state, VelocityTracker::Estimator* outEstimator) const; }; } // namespace android |