OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |