| commit | 540dc07e42ce5188d3e7897256ba6e0d8671b903 | [log] [tgz] |
|---|---|---|
| author | Yeabkal Wubshit <yeabkal@google.com> | Thu Mar 09 17:11:39 2023 +0000 |
| committer | Yeabkal Wubshit <yeabkal@google.com> | Thu Mar 09 16:14:26 2023 -0800 |
| tree | 854debeada0b3287f622cd17557bc3ca85ff6f1a | |
| parent | 3700a8f58fcb4dc80cf6c063ae5768ef36564854 [diff] |
Avoid RingBuffer creation on each VelocityTracker#add call The code used to create a new RingBuffer each time a movement was added to VelocityTracker. This is expensive, and it showed up as a regression in our benchmark tests. With this change, we create a new RingBuffer for a pointerId only if there is not one already. Bug: 267211645 Bug: 271935895 Test: atest libinput_tests, benchmark test regression fixed Change-Id: I47c6dda5741459a1bd84f3f5f46f932c26fda523