Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Prabir Pradhan | c08b0db | 2022-09-10 00:57:15 +0000 | [diff] [blame] | 17 | #pragma once |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 18 | |
| 19 | #include <input/Input.h> |
Yeabkal Wubshit | 64f090f | 2023-03-03 17:35:11 -0800 | [diff] [blame] | 20 | #include <input/RingBuffer.h> |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 21 | #include <utils/BitSet.h> |
Chris Ye | f859148 | 2020-04-17 11:49:17 -0700 | [diff] [blame] | 22 | #include <utils/Timers.h> |
Yeabkal Wubshit | 384ab0f | 2022-09-09 16:39:18 +0000 | [diff] [blame] | 23 | #include <map> |
| 24 | #include <set> |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 25 | |
| 26 | namespace android { |
| 27 | |
| 28 | class VelocityTrackerStrategy; |
| 29 | |
| 30 | /* |
| 31 | * Calculates the velocity of pointer movements over time. |
| 32 | */ |
| 33 | class VelocityTracker { |
| 34 | public: |
Yeabkal Wubshit | 9b4443f | 2023-02-23 23:35:07 -0800 | [diff] [blame] | 35 | static const size_t MAX_DEGREE = 4; |
| 36 | |
Chris Ye | f859148 | 2020-04-17 11:49:17 -0700 | [diff] [blame] | 37 | enum class Strategy : int32_t { |
| 38 | DEFAULT = -1, |
| 39 | MIN = 0, |
| 40 | IMPULSE = 0, |
| 41 | LSQ1 = 1, |
| 42 | LSQ2 = 2, |
| 43 | LSQ3 = 3, |
| 44 | WLSQ2_DELTA = 4, |
| 45 | WLSQ2_CENTRAL = 5, |
| 46 | WLSQ2_RECENT = 6, |
| 47 | INT1 = 7, |
| 48 | INT2 = 8, |
| 49 | LEGACY = 9, |
| 50 | MAX = LEGACY, |
Siarhei Vishniakou | 8a2e589 | 2023-08-14 13:59:40 -0700 | [diff] [blame^] | 51 | ftl_last = LEGACY, |
Chris Ye | f859148 | 2020-04-17 11:49:17 -0700 | [diff] [blame] | 52 | }; |
| 53 | |
Yeabkal Wubshit | 384ab0f | 2022-09-09 16:39:18 +0000 | [diff] [blame] | 54 | /* |
| 55 | * Contains all available velocity data from a VelocityTracker. |
| 56 | */ |
| 57 | struct ComputedVelocity { |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 58 | inline std::optional<float> getVelocity(int32_t axis, int32_t id) const { |
Yeabkal Wubshit | 384ab0f | 2022-09-09 16:39:18 +0000 | [diff] [blame] | 59 | const auto& axisVelocities = mVelocities.find(axis); |
| 60 | if (axisVelocities == mVelocities.end()) { |
| 61 | return {}; |
| 62 | } |
| 63 | |
| 64 | const auto& axisIdVelocity = axisVelocities->second.find(id); |
| 65 | if (axisIdVelocity == axisVelocities->second.end()) { |
| 66 | return {}; |
| 67 | } |
| 68 | |
| 69 | return axisIdVelocity->second; |
| 70 | } |
| 71 | |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 72 | inline void addVelocity(int32_t axis, int32_t id, float velocity) { |
Yeabkal Wubshit | 384ab0f | 2022-09-09 16:39:18 +0000 | [diff] [blame] | 73 | mVelocities[axis][id] = velocity; |
| 74 | } |
| 75 | |
| 76 | private: |
| 77 | std::map<int32_t /*axis*/, std::map<int32_t /*pointerId*/, float /*velocity*/>> mVelocities; |
| 78 | }; |
| 79 | |
| 80 | // Creates a velocity tracker using the specified strategy for each supported axis. |
Chris Ye | f859148 | 2020-04-17 11:49:17 -0700 | [diff] [blame] | 81 | // If strategy is not provided, uses the default strategy for the platform. |
Yeabkal Wubshit | 384ab0f | 2022-09-09 16:39:18 +0000 | [diff] [blame] | 82 | // TODO(b/32830165): support axis-specific strategies. |
Chris Ye | f859148 | 2020-04-17 11:49:17 -0700 | [diff] [blame] | 83 | VelocityTracker(const Strategy strategy = Strategy::DEFAULT); |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 84 | |
Yeabkal Wubshit | eca273c | 2022-10-05 19:06:40 -0700 | [diff] [blame] | 85 | /** Return true if the axis is supported for velocity tracking, false otherwise. */ |
| 86 | static bool isAxisSupported(int32_t axis); |
| 87 | |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 88 | // Resets the velocity tracker state. |
| 89 | void clear(); |
| 90 | |
Siarhei Vishniakou | 8d23203 | 2023-01-11 08:17:21 -0800 | [diff] [blame] | 91 | // Resets the velocity tracker state for a specific pointer. |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 92 | // Call this method when some pointers have changed and may be reusing |
| 93 | // an id that was assigned to a different pointer earlier. |
Siarhei Vishniakou | 8d23203 | 2023-01-11 08:17:21 -0800 | [diff] [blame] | 94 | void clearPointer(int32_t pointerId); |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 95 | |
Siarhei Vishniakou | 8d23203 | 2023-01-11 08:17:21 -0800 | [diff] [blame] | 96 | // Adds movement information for a pointer for a specific axis |
| 97 | void addMovement(nsecs_t eventTime, int32_t pointerId, int32_t axis, float position); |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 98 | |
| 99 | // Adds movement information for all pointers in a MotionEvent, including historical samples. |
| 100 | void addMovement(const MotionEvent* event); |
| 101 | |
Yeabkal Wubshit | 384ab0f | 2022-09-09 16:39:18 +0000 | [diff] [blame] | 102 | // Returns the velocity of the specified pointer id and axis in position units per second. |
| 103 | // Returns empty optional if there is insufficient movement information for the pointer, or if |
| 104 | // the given axis is not supported for velocity tracking. |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 105 | std::optional<float> getVelocity(int32_t axis, int32_t pointerId) const; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 106 | |
Yeabkal Wubshit | 384ab0f | 2022-09-09 16:39:18 +0000 | [diff] [blame] | 107 | // Returns a ComputedVelocity instance with all available velocity data, using the given units |
| 108 | // (reference: units == 1 means "per millisecond"), and clamping each velocity between |
| 109 | // [-maxVelocity, maxVelocity], inclusive. |
| 110 | ComputedVelocity getComputedVelocity(int32_t units, float maxVelocity); |
| 111 | |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 112 | // Gets the active pointer id, or -1 if none. |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 113 | inline int32_t getActivePointerId() const { return mActivePointerId.value_or(-1); } |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 114 | |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 115 | private: |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 116 | nsecs_t mLastEventTime; |
| 117 | BitSet32 mCurrentPointerIdBits; |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 118 | std::optional<int32_t> mActivePointerId; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 119 | |
Yeabkal Wubshit | 47ff708 | 2022-09-10 23:09:15 -0700 | [diff] [blame] | 120 | // An override strategy passed in the constructor to be used for all axes. |
| 121 | // This strategy will apply to all axes, unless the default strategy is specified here. |
| 122 | // When default strategy is specified, then each axis will use a potentially different strategy |
| 123 | // based on a hardcoded mapping. |
| 124 | const Strategy mOverrideStrategy; |
| 125 | // Maps axes to their respective VelocityTrackerStrategy instances. |
| 126 | // Note that, only axes that have had MotionEvents (and not all supported axes) will be here. |
| 127 | std::map<int32_t /*axis*/, std::unique_ptr<VelocityTrackerStrategy>> mConfiguredStrategies; |
| 128 | |
| 129 | void configureStrategy(int32_t axis); |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 130 | |
Yeabkal Wubshit | 73c9508 | 2022-09-22 10:12:33 +0000 | [diff] [blame] | 131 | // Generates a VelocityTrackerStrategy instance for the given Strategy type. |
| 132 | // The `deltaValues` parameter indicates whether or not the created strategy should treat motion |
| 133 | // values as deltas (and not as absolute values). This the parameter is applicable only for |
| 134 | // strategies that support differential axes. |
Yeabkal Wubshit | 0bb5e59 | 2022-09-14 01:22:28 -0700 | [diff] [blame] | 135 | static std::unique_ptr<VelocityTrackerStrategy> createStrategy(const Strategy strategy, |
Yeabkal Wubshit | 73c9508 | 2022-09-22 10:12:33 +0000 | [diff] [blame] | 136 | bool deltaValues); |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 137 | }; |
| 138 | |
| 139 | |
| 140 | /* |
| 141 | * Implements a particular velocity tracker algorithm. |
| 142 | */ |
| 143 | class VelocityTrackerStrategy { |
| 144 | protected: |
| 145 | VelocityTrackerStrategy() { } |
| 146 | |
| 147 | public: |
| 148 | virtual ~VelocityTrackerStrategy() { } |
| 149 | |
Siarhei Vishniakou | 8d23203 | 2023-01-11 08:17:21 -0800 | [diff] [blame] | 150 | virtual void clearPointer(int32_t pointerId) = 0; |
| 151 | virtual void addMovement(nsecs_t eventTime, int32_t pointerId, float position) = 0; |
Yeabkal Wubshit | 9b4443f | 2023-02-23 23:35:07 -0800 | [diff] [blame] | 152 | virtual std::optional<float> getVelocity(int32_t pointerId) const = 0; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 153 | }; |
| 154 | |
Yeabkal Wubshit | a0e573c | 2023-03-02 21:08:14 -0800 | [diff] [blame] | 155 | /** |
| 156 | * A `VelocityTrackerStrategy` that accumulates added data points and processes the accumulated data |
| 157 | * points when getting velocity. |
| 158 | */ |
| 159 | class AccumulatingVelocityTrackerStrategy : public VelocityTrackerStrategy { |
| 160 | public: |
Yeabkal Wubshit | 4a678b2 | 2023-02-23 17:03:40 -0800 | [diff] [blame] | 161 | AccumulatingVelocityTrackerStrategy(nsecs_t horizonNanos, bool maintainHorizonDuringAdd); |
| 162 | |
Yeabkal Wubshit | a0e573c | 2023-03-02 21:08:14 -0800 | [diff] [blame] | 163 | void addMovement(nsecs_t eventTime, int32_t pointerId, float position) override; |
| 164 | void clearPointer(int32_t pointerId) override; |
| 165 | |
| 166 | protected: |
| 167 | struct Movement { |
| 168 | nsecs_t eventTime; |
| 169 | float position; |
| 170 | }; |
| 171 | |
| 172 | // Number of samples to keep. |
| 173 | // If different strategies would like to maintain different history size, we can make this a |
| 174 | // protected const field. |
| 175 | static constexpr uint32_t HISTORY_SIZE = 20; |
| 176 | |
Yeabkal Wubshit | 4a678b2 | 2023-02-23 17:03:40 -0800 | [diff] [blame] | 177 | /** |
| 178 | * Duration, in nanoseconds, since the latest movement where a movement may be considered for |
| 179 | * velocity calculation. |
| 180 | */ |
| 181 | const nsecs_t mHorizonNanos; |
| 182 | /** |
| 183 | * If true, data points outside of horizon (see `mHorizonNanos`) will be cleared after each |
| 184 | * addition of a new movement. |
| 185 | */ |
| 186 | const bool mMaintainHorizonDuringAdd; |
Yeabkal Wubshit | 64f090f | 2023-03-03 17:35:11 -0800 | [diff] [blame] | 187 | std::map<int32_t /*pointerId*/, RingBuffer<Movement>> mMovements; |
Yeabkal Wubshit | a0e573c | 2023-03-02 21:08:14 -0800 | [diff] [blame] | 188 | }; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 189 | |
| 190 | /* |
| 191 | * Velocity tracker algorithm based on least-squares linear regression. |
| 192 | */ |
Yeabkal Wubshit | a0e573c | 2023-03-02 21:08:14 -0800 | [diff] [blame] | 193 | class LeastSquaresVelocityTrackerStrategy : public AccumulatingVelocityTrackerStrategy { |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 194 | public: |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 195 | enum class Weighting { |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 196 | // No weights applied. All data points are equally reliable. |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 197 | NONE, |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 198 | |
| 199 | // Weight by time delta. Data points clustered together are weighted less. |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 200 | DELTA, |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 201 | |
| 202 | // Weight such that points within a certain horizon are weighed more than those |
| 203 | // outside of that horizon. |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 204 | CENTRAL, |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 205 | |
| 206 | // Weight such that points older than a certain amount are weighed less. |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 207 | RECENT, |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 208 | }; |
| 209 | |
Yeabkal Wubshit | 9b4443f | 2023-02-23 23:35:07 -0800 | [diff] [blame] | 210 | // Degree must be no greater than VelocityTracker::MAX_DEGREE. |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 211 | LeastSquaresVelocityTrackerStrategy(uint32_t degree, Weighting weighting = Weighting::NONE); |
| 212 | ~LeastSquaresVelocityTrackerStrategy() override; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 213 | |
Yeabkal Wubshit | 9b4443f | 2023-02-23 23:35:07 -0800 | [diff] [blame] | 214 | std::optional<float> getVelocity(int32_t pointerId) const override; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 215 | |
| 216 | private: |
| 217 | // Sample horizon. |
| 218 | // We don't use too much history by default since we want to react to quick |
| 219 | // changes in direction. |
| 220 | static const nsecs_t HORIZON = 100 * 1000000; // 100 ms |
| 221 | |
Siarhei Vishniakou | 8d23203 | 2023-01-11 08:17:21 -0800 | [diff] [blame] | 222 | float chooseWeight(int32_t pointerId, uint32_t index) const; |
Yeabkal Wubshit | fa806e4 | 2023-03-06 18:34:07 -0800 | [diff] [blame] | 223 | /** |
| 224 | * An optimized least-squares solver for degree 2 and no weight (i.e. `Weighting.NONE`). |
| 225 | * The provided container of movements shall NOT be empty, and shall have the movements in |
| 226 | * chronological order. |
| 227 | */ |
| 228 | std::optional<float> solveUnweightedLeastSquaresDeg2( |
| 229 | const RingBuffer<Movement>& movements) const; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 230 | |
| 231 | const uint32_t mDegree; |
| 232 | const Weighting mWeighting; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 233 | }; |
| 234 | |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 235 | /* |
| 236 | * Velocity tracker algorithm that uses an IIR filter. |
| 237 | */ |
| 238 | class IntegratingVelocityTrackerStrategy : public VelocityTrackerStrategy { |
| 239 | public: |
| 240 | // Degree must be 1 or 2. |
| 241 | IntegratingVelocityTrackerStrategy(uint32_t degree); |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 242 | ~IntegratingVelocityTrackerStrategy() override; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 243 | |
Siarhei Vishniakou | 8d23203 | 2023-01-11 08:17:21 -0800 | [diff] [blame] | 244 | void clearPointer(int32_t pointerId) override; |
| 245 | void addMovement(nsecs_t eventTime, int32_t pointerId, float positions) override; |
Yeabkal Wubshit | 9b4443f | 2023-02-23 23:35:07 -0800 | [diff] [blame] | 246 | std::optional<float> getVelocity(int32_t pointerId) const override; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 247 | |
| 248 | private: |
| 249 | // Current state estimate for a particular pointer. |
| 250 | struct State { |
| 251 | nsecs_t updateTime; |
| 252 | uint32_t degree; |
| 253 | |
Yeabkal Wubshit | 384ab0f | 2022-09-09 16:39:18 +0000 | [diff] [blame] | 254 | float pos, vel, accel; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 255 | }; |
| 256 | |
| 257 | const uint32_t mDegree; |
| 258 | BitSet32 mPointerIdBits; |
| 259 | State mPointerState[MAX_POINTER_ID + 1]; |
| 260 | |
Yeabkal Wubshit | 384ab0f | 2022-09-09 16:39:18 +0000 | [diff] [blame] | 261 | void initState(State& state, nsecs_t eventTime, float pos) const; |
| 262 | void updateState(State& state, nsecs_t eventTime, float pos) const; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 263 | }; |
| 264 | |
| 265 | |
| 266 | /* |
| 267 | * Velocity tracker strategy used prior to ICS. |
| 268 | */ |
Yeabkal Wubshit | a0e573c | 2023-03-02 21:08:14 -0800 | [diff] [blame] | 269 | class LegacyVelocityTrackerStrategy : public AccumulatingVelocityTrackerStrategy { |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 270 | public: |
| 271 | LegacyVelocityTrackerStrategy(); |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 272 | ~LegacyVelocityTrackerStrategy() override; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 273 | |
Yeabkal Wubshit | 9b4443f | 2023-02-23 23:35:07 -0800 | [diff] [blame] | 274 | std::optional<float> getVelocity(int32_t pointerId) const override; |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 275 | |
| 276 | private: |
| 277 | // Oldest sample to consider when calculating the velocity. |
| 278 | static const nsecs_t HORIZON = 200 * 1000000; // 100 ms |
| 279 | |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 280 | // The minimum duration between samples when estimating velocity. |
| 281 | static const nsecs_t MIN_DURATION = 10 * 1000000; // 10 ms |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 282 | }; |
| 283 | |
Yeabkal Wubshit | a0e573c | 2023-03-02 21:08:14 -0800 | [diff] [blame] | 284 | class ImpulseVelocityTrackerStrategy : public AccumulatingVelocityTrackerStrategy { |
Siarhei Vishniakou | 00a4ea9 | 2017-06-08 21:43:20 +0100 | [diff] [blame] | 285 | public: |
Yeabkal Wubshit | 0bb5e59 | 2022-09-14 01:22:28 -0700 | [diff] [blame] | 286 | ImpulseVelocityTrackerStrategy(bool deltaValues); |
Siarhei Vishniakou | 657a173 | 2023-01-12 11:58:52 -0800 | [diff] [blame] | 287 | ~ImpulseVelocityTrackerStrategy() override; |
Siarhei Vishniakou | 00a4ea9 | 2017-06-08 21:43:20 +0100 | [diff] [blame] | 288 | |
Yeabkal Wubshit | 9b4443f | 2023-02-23 23:35:07 -0800 | [diff] [blame] | 289 | std::optional<float> getVelocity(int32_t pointerId) const override; |
Siarhei Vishniakou | 00a4ea9 | 2017-06-08 21:43:20 +0100 | [diff] [blame] | 290 | |
| 291 | private: |
| 292 | // Sample horizon. |
| 293 | // We don't use too much history by default since we want to react to quick |
| 294 | // changes in direction. |
| 295 | static constexpr nsecs_t HORIZON = 100 * 1000000; // 100 ms |
| 296 | |
Yeabkal Wubshit | 0bb5e59 | 2022-09-14 01:22:28 -0700 | [diff] [blame] | 297 | // Whether or not the input movement values for the strategy come in the form of delta values. |
| 298 | // If the input values are not deltas, the strategy needs to calculate deltas as part of its |
| 299 | // velocity calculation. |
| 300 | const bool mDeltaValues; |
Siarhei Vishniakou | 00a4ea9 | 2017-06-08 21:43:20 +0100 | [diff] [blame] | 301 | }; |
| 302 | |
Jeff Brown | 5912f95 | 2013-07-01 19:10:31 -0700 | [diff] [blame] | 303 | } // namespace android |