Chromium Code Reviews| Index: cc/trees/layer_tree_host_impl.cc |
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
| index 3c4bb306dfb03f97d06cd67a23ad734995ede71f..a771e15c13431902db3c7d2222da14c01ea0affc 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -1640,12 +1640,19 @@ bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) { |
| } |
| CompositorFrameMetadata metadata = MakeCompositorFrameMetadata(); |
| active_tree()->FinishSwapPromises(&metadata); |
| - for (size_t i = 0; i < metadata.latency_info.size(); i++) { |
| + for (auto& latency : metadata.latency_info) { |
| TRACE_EVENT_FLOW_STEP0( |
| "input,benchmark", |
| "LatencyInfo.Flow", |
| - TRACE_ID_DONT_MANGLE(metadata.latency_info[i].trace_id), |
| + TRACE_ID_DONT_MANGLE(latency.trace_id), |
| "SwapBuffers"); |
| + // Only add the latency component once for renderer swap, not the browser |
| + // swap. |
| + if (!latency.FindLatency(ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, |
|
jdduke (slow)
2015/02/11 23:22:02
This seems like a common operation (adding a comon
Yufeng Shen (Slow to review)
2015/02/12 02:59:02
will do a follow up for this.
|
| + 0, nullptr)) { |
| + latency.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, |
| + 0, 0); |
| + } |
| } |
| renderer_->SwapBuffers(metadata); |
| return true; |