Commit 990aaa39 authored by Chong Zhang's avatar Chong Zhang Committed by Commit Bot

[Android] Use oldest historical event time as hardware timestamp

On other platforms we recored hardware timestamp to measure end-to-end
latency, however on Android the 'hardware timestamp' we got is actually
a resample (or latest) timestamp due to it's event batching mechanism.

This patch switched to use the oldest historical event time to match
other platforms and for better measuring of end-to-end performance.

Expecting to see regressions in UMA similar to
'Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin2',
e.g. Probably a 10ms ~ 20ms increase.

Note: This patch has no effect on telemetry tests.

Bug: 737379
Change-Id: I3bb4349ec1a47dc497817d70c2c5a64ed40f910a
Reviewed-on: https://chromium-review.googlesource.com/577962Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarAlexandre Elias <aelias@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Chong Zhang <chongz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488447}
parent 1201acfa
......@@ -78,6 +78,12 @@ public class EventForwarder {
TraceEvent.begin("sendTouchEvent");
try {
// Android may batch multiple events together for efficiency. We
// want to use the oldest event time as hardware time stamp.
final long oldestEventTime = event.getHistorySize() > 0
? event.getHistoricalEventTime(0)
: event.getEventTime();
int eventAction = event.getActionMasked();
eventAction = SPenSupport.convertSPenEventAction(eventAction);
......@@ -107,7 +113,7 @@ public class EventForwarder {
}
final boolean consumed = nativeOnTouchEvent(mNativeEventForwarder, event,
event.getEventTime(), eventAction, pointerCount, event.getHistorySize(),
oldestEventTime, eventAction, pointerCount, event.getHistorySize(),
event.getActionIndex(), event.getX(), event.getY(),
pointerCount > 1 ? event.getX(1) : 0, pointerCount > 1 ? event.getY(1) : 0,
event.getPointerId(0), pointerCount > 1 ? event.getPointerId(1) : -1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment