Fix time delta calculation in scroll buffer

When calculating fling velocity, we use the average velocity of the last
several scroll events. However, zero-distance scrolls are not included
in the buffer, which can skew the velocity, especially if the touchpad
reports MSC_TIMESTAMP events when no finger has moved.

This CL addresses that by keeping track of the time delta from the
latest scroll event in the scroll buffer for calculating velocity,
instead of just the delta between touchpad reports, which will always be
very small if the touchpad reports MSC_TIMESTAMP.

BUG=b:358209681
TEST=unittests, touchtests regression suite, manual testing

Change-Id: I41db2867f4d50021f713350470e85f2d453af51e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/5806234
Tested-by: Sean O'Brien <[email protected]>
Reviewed-by: Henry Barnor <[email protected]>
Auto-Submit: Sean O'Brien <[email protected]>
Commit-Queue: Sean O'Brien <[email protected]>
Code-Coverage: Zoss <[email protected]>
4 files changed