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
Loading
Please register or sign in to comment