| 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..d364ed2301b6ba9dade68511be7be4529fb50e90 100644
|
| --- a/ui/events/gestures/gesture_sequence.cc
|
| +++ b/ui/events/gestures/gesture_sequence.cc
|
| @@ -350,6 +350,32 @@ float CalibrateFlingVelocity(float velocity) {
|
| return std::min(nu * velocity, GestureConfiguration::fling_velocity_cap());
|
| }
|
|
|
| +
|
| +void UpdateGestureEventLatencyInfo(const TouchEvent& event,
|
| + GestureSequence::Gestures* gestures) {
|
| + // 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 {
|
| + GestureSequence::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;
|
| + }
|
| + }
|
| + }
|
| +}
|
| +
|
| } // namespace
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| @@ -596,12 +622,7 @@ 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);
|
| - }
|
| -
|
| + UpdateGestureEventLatencyInfo(event, gestures.get());
|
| return gestures.release();
|
| }
|
|
|
|
|