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

Unified Diff: content/browser/renderer_host/render_widget_host_latency_tracker.cc

Issue 918883002: Change input latency result to depend on start of GPU swap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup RWHLT Created 5 years, 10 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: content/browser/renderer_host/render_widget_host_latency_tracker.cc
diff --git a/content/browser/renderer_host/render_widget_host_latency_tracker.cc b/content/browser/renderer_host/render_widget_host_latency_tracker.cc
index 2d738c491910c4d429709da26d4ecd6193f9105b..8b5ba137e1ac2c154be8292fd545787f29c2b62d 100644
--- a/content/browser/renderer_host/render_widget_host_latency_tracker.cc
+++ b/content/browser/renderer_host/render_widget_host_latency_tracker.cc
@@ -136,10 +136,10 @@ void ComputeInputLatencyHistograms(WebInputEvent::Type type,
}
void ComputeScrollLatencyHistograms(
- const LatencyInfo::LatencyComponent& swap_component,
+ const LatencyInfo::LatencyComponent& gpu_swap_component,
int64 latency_component_id,
- const ui::LatencyInfo& latency) {
- DCHECK(!swap_component.event_time.is_null());
+ const LatencyInfo& latency) {
+ DCHECK(!gpu_swap_component.event_time.is_null());
LatencyInfo::LatencyComponent first_original_component, original_component;
if (latency.FindLatency(
ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT,
@@ -150,7 +150,7 @@ void ComputeScrollLatencyHistograms(
for (size_t i = 0; i < first_original_component.event_count; i++) {
UMA_HISTOGRAM_CUSTOM_COUNTS(
"Event.Latency.TouchToFirstScrollUpdateSwap",
- (swap_component.event_time - first_original_component.event_time)
+ (gpu_swap_component.event_time - first_original_component.event_time)
.InMicroseconds(),
1, 1000000, 100);
}
@@ -167,7 +167,7 @@ void ComputeScrollLatencyHistograms(
for (size_t i = 0; i < original_component.event_count; i++) {
UMA_HISTOGRAM_CUSTOM_COUNTS(
"Event.Latency.TouchToScrollUpdateSwap",
- (swap_component.event_time - original_component.event_time)
+ (gpu_swap_component.event_time - original_component.event_time)
.InMicroseconds(),
1, 1000000, 100);
}
@@ -312,11 +312,10 @@ void RenderWidgetHostLatencyTracker::OnSwapCompositorFrame(
}
void RenderWidgetHostLatencyTracker::OnFrameSwapped(
- const ui::LatencyInfo& latency) {
- LatencyInfo::LatencyComponent swap_component;
- if (!latency.FindLatency(
- ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0,
- &swap_component)) {
+ const LatencyInfo& latency) {
+ LatencyInfo::LatencyComponent gpu_swap_component;
+ if (!latency.FindLatency(ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0,
+ &gpu_swap_component)) {
return;
}
@@ -324,7 +323,7 @@ void RenderWidgetHostLatencyTracker::OnFrameSwapped(
if (latency.FindLatency(ui::TAB_SHOW_COMPONENT, latency_component_id_,
&tab_switch_component)) {
base::TimeDelta delta =
- swap_component.event_time - tab_switch_component.event_time;
+ gpu_swap_component.event_time - tab_switch_component.event_time;
for (size_t i = 0; i < tab_switch_component.event_count; i++) {
UMA_HISTOGRAM_TIMES("MPArch.RWH_TabSwitchPaintDuration", delta);
}
@@ -336,16 +335,10 @@ void RenderWidgetHostLatencyTracker::OnFrameSwapped(
return;
}
- ComputeScrollLatencyHistograms(swap_component, latency_component_id_,
+ ComputeScrollLatencyHistograms(gpu_swap_component, latency_component_id_,
latency);
- ui::LatencyInfo::LatencyComponent gpu_swap_component;
- if (!latency.FindLatency(ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0,
- &gpu_swap_component)) {
- return;
- }
-
- ui::LatencyInfo::LatencyComponent browser_swap_component;
+ LatencyInfo::LatencyComponent browser_swap_component;
if (latency.FindLatency(
ui::INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT, 0,
&browser_swap_component)) {

Powered by Google App Engine
This is Rietveld 408576698