Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Unified Diff: ui/events/gestures/gesture_sequence.cc

Issue 25022003: Report LatencyInfo through trace buffer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix compile error Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/event.cc ('k') | ui/events/latency_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « ui/events/event.cc ('k') | ui/events/latency_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698