| Index: ui/events/gestures/gesture_sequence.cc
|
| diff --git a/ui/events/gestures/gesture_sequence.cc b/ui/events/gestures/gesture_sequence.cc
|
| index 83266856e8cecac1dbb3ebdb944a575ea2d684df..c0c8171b58479cc554bd2c803f3e88ba259aed55 100644
|
| --- a/ui/events/gestures/gesture_sequence.cc
|
| +++ b/ui/events/gestures/gesture_sequence.cc
|
| @@ -596,10 +596,26 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture(
|
| }
|
| }
|
|
|
| - const ui::LatencyInfo* touch_latency = event.latency();
|
| - Gestures::iterator it = gestures->begin();
|
| - for (; it != gestures->end(); it++) {
|
| - (*it)->latency()->MergeWith(*touch_latency);
|
| + // If the touch event does not cause any rendering scheduled, then
|
| + // 1) If the touch event does not generate any gesture event, its
|
| + // LatencyInfo ends here.
|
| + // 2) If the touch event generates gesture events, its latencyinfo
|
| + // is copied into the gesture events.
|
| + if (!event.latency()->FindLatency(
|
| + ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL)) {
|
| + if (gestures->empty()) {
|
| + ui::LatencyInfo* touch_latency =
|
| + const_cast<ui::LatencyInfo*>(event.latency());
|
| + touch_latency->AddLatencyNumber(
|
| + ui::INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT, 0, 0);
|
| + } else {
|
| + Gestures::iterator it = gestures->begin();
|
| + for (; it != gestures->end(); it++) {
|
| + (*it)->latency()->MergeWith(*event.latency());
|
| + // Inheriting the trace_id from the touch event's LatencyInfo
|
| + (*it)->latency()->trace_id = event.latency()->trace_id;
|
| + }
|
| + }
|
| }
|
|
|
| return gestures.release();
|
|
|