Closed Bug 1615858 Opened 4 years ago Closed 4 years ago

Improve precision of touch velocity computation by taking "historical" events into account

Categories

(Core :: Panning and Zooming, enhancement, P3)

All
Android
enhancement

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 3 obsolete files)

On Android, MotionEvent lets you access "historical" event data for the original events that were batched into one MotionEvent. Chrome makes use of these events in its velocity tracker, and we should probably do the same.

Summary: Improve precision of touch velocity computation by taking into account "historical" events → Improve precision of touch velocity computation by taking "historical" events into account

Is this something that came up while you were working on bug 1458653? If so, are you planning to take this bug, or are you spinning it out for somebody else to tackle?

Flags: needinfo?(mstange)
Priority: -- → P3
See Also: → 1458653

It is something that I stumbled over as part of the investigation into that bug, but it's probably not essential to do for that bug. I'm not planning to work on this.

Flags: needinfo?(mstange)

I'm going to take a quick stab at it. It seems that my Moto G5 samples the touch screen at a rate of 100Hz. Since vsync happens at 60Hz, and touch events are dispatched in alignment with vsync, that means that each touch event is the result of one or two touch screen samples. An increase of 50% touch data would definitely make it easier for the AndroidVelocityTracker to compute accurate velocities.

Assignee: nobody → mstange.moz
Status: NEW → ASSIGNED

This also adds a test. The velocities computed in the test are the following:

SimpleVelocityTracker: 0.65 with full data, 0.467 with partial data
AndroidVelocityTracker: 1.225 with full data, 0.833 with partial data

Depends on D95645

Attachment #9185357 - Attachment is obsolete: true
Attachment #9185358 - Attachment is obsolete: true
Attachment #9185359 - Attachment is obsolete: true

This also adds a test. The velocities computed in the test are the following:

SimpleVelocityTracker: 0.65 with full data, 0.467 with partial data
AndroidVelocityTracker: 1.225 with full data, 0.833 with partial data

Depends on D95650

Attachment #9185363 - Attachment description: Bug 1615858 - Add MultiTouchInput::SingleTouchData::mHistoricalCoords to store historical touch data. r=kats → Bug 1615858 - Add MultiTouchInput::SingleTouchData::mHistoricalData. r=kats
Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/4c5fdaab5f27
Add MultiTouchInput::SingleTouchData::mHistoricalData. r=kats
https://hg.mozilla.org/integration/autoland/rev/b4f668a31f18
Propagate historical touch data from Java to C++. r=kats,geckoview-reviewers,agi
https://hg.mozilla.org/integration/autoland/rev/bf8313268c20
Take historical touch positions into account when estimating touch velocity. r=kats
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: