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

Unified Diff: cc/surfaces/surface_factory.cc

Issue 2771053003: WIP: Plumbing input event latency reporting through Mus GPU.
Patch Set: Created 3 years, 9 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
Index: cc/surfaces/surface_factory.cc
diff --git a/cc/surfaces/surface_factory.cc b/cc/surfaces/surface_factory.cc
index 880cb8c828a675fe85cd426bfb9caa05355e6cbc..c92bda0c8081bb9c9bd0bcd51da38652418ad63e 100644
--- a/cc/surfaces/surface_factory.cc
+++ b/cc/surfaces/surface_factory.cc
@@ -47,6 +47,20 @@ void SurfaceFactory::SubmitCompositorFrame(
const DrawCallback& callback) {
TRACE_EVENT0("cc", "SurfaceFactory::SubmitCompositorFrame");
DCHECK(local_surface_id.is_valid());
+
+ for (ui::LatencyInfo& latency : frame.metadata.latency_info) {
+ // TODO: These latencies need to be saved somehow.
+ // TODO: Rename INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT
+ // TODO: Remove similar code in RWHLatencyTracker?
+ // TODO: Better if? Maybe just check if latency_info has ANY components?
+ if (latency.FindLatency(ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, nullptr) ||
+ latency.FindLatency(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, nullptr) ||
+ latency.FindLatency(ui::TAB_SHOW_COMPONENT, nullptr)) {
+ latency.AddLatencyNumber(
+ ui::INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT, 0, 0);
+ }
+ }
+
std::unique_ptr<Surface> surface;
bool create_new_surface =
(!current_surface_ ||

Powered by Google App Engine
This is Rietveld 408576698