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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 1239593002: Implement a new flow event API that allows binding flow events and regular events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add support for flow steps. Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 1735
1736 bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) { 1736 bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) {
1737 ResetRequiresHighResToDraw(); 1737 ResetRequiresHighResToDraw();
1738 if (frame.has_no_damage) { 1738 if (frame.has_no_damage) {
1739 active_tree()->BreakSwapPromises(SwapPromise::SWAP_FAILS); 1739 active_tree()->BreakSwapPromises(SwapPromise::SWAP_FAILS);
1740 return false; 1740 return false;
1741 } 1741 }
1742 CompositorFrameMetadata metadata = MakeCompositorFrameMetadata(); 1742 CompositorFrameMetadata metadata = MakeCompositorFrameMetadata();
1743 active_tree()->FinishSwapPromises(&metadata); 1743 active_tree()->FinishSwapPromises(&metadata);
1744 for (auto& latency : metadata.latency_info) { 1744 for (auto& latency : metadata.latency_info) {
1745 TRACE_EVENT_WITH_FLOW0("toplevel", "LayerTreeHostImpl::SwapBuffer",
1746 TRACE_ID_DONT_MANGLE(latency.trace_id),
1747 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT) ;
1745 TRACE_EVENT_FLOW_STEP0( 1748 TRACE_EVENT_FLOW_STEP0(
1746 "input,benchmark", 1749 "input,benchmark",
1747 "LatencyInfo.Flow", 1750 "LatencyInfo.Flow",
1748 TRACE_ID_DONT_MANGLE(latency.trace_id), 1751 TRACE_ID_DONT_MANGLE(latency.trace_id),
1749 "SwapBuffers"); 1752 "SwapBuffers");
1750 // Only add the latency component once for renderer swap, not the browser 1753 // Only add the latency component once for renderer swap, not the browser
1751 // swap. 1754 // swap.
1752 if (!latency.FindLatency(ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, 1755 if (!latency.FindLatency(ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT,
1753 0, nullptr)) { 1756 0, nullptr)) {
1754 latency.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, 1757 latency.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT,
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after
3607 if (active_tree()) { 3610 if (active_tree()) {
3608 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); 3611 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id);
3609 if (layer) 3612 if (layer)
3610 return layer->ScrollOffsetForAnimation(); 3613 return layer->ScrollOffsetForAnimation();
3611 } 3614 }
3612 3615
3613 return gfx::ScrollOffset(); 3616 return gfx::ScrollOffset();
3614 } 3617 }
3615 3618
3616 } // namespace cc 3619 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698