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.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <stack> | 8 #include <stack> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/atomic_sequence_num.h" | 11 #include "base/atomic_sequence_num.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/debug/trace_event.h" | 14 #include "base/debug/trace_event.h" |
15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
19 #include "cc/animation/animation_registrar.h" | 19 #include "cc/animation/animation_registrar.h" |
20 #include "cc/animation/layer_animation_controller.h" | 20 #include "cc/animation/layer_animation_controller.h" |
21 #include "cc/base/latency_info_swap_promise.h" | |
21 #include "cc/base/math_util.h" | 22 #include "cc/base/math_util.h" |
22 #include "cc/debug/devtools_instrumentation.h" | 23 #include "cc/debug/devtools_instrumentation.h" |
23 #include "cc/debug/rendering_stats_instrumentation.h" | 24 #include "cc/debug/rendering_stats_instrumentation.h" |
24 #include "cc/input/layer_selection_bound.h" | 25 #include "cc/input/layer_selection_bound.h" |
25 #include "cc/input/top_controls_manager.h" | 26 #include "cc/input/top_controls_manager.h" |
26 #include "cc/layers/heads_up_display_layer.h" | 27 #include "cc/layers/heads_up_display_layer.h" |
27 #include "cc/layers/heads_up_display_layer_impl.h" | 28 #include "cc/layers/heads_up_display_layer_impl.h" |
28 #include "cc/layers/layer.h" | 29 #include "cc/layers/layer.h" |
29 #include "cc/layers/layer_iterator.h" | 30 #include "cc/layers/layer_iterator.h" |
30 #include "cc/layers/painted_scrollbar_layer.h" | 31 #include "cc/layers/painted_scrollbar_layer.h" |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1014 occlusion_tracker.LeaveLayer(it); | 1015 occlusion_tracker.LeaveLayer(it); |
1015 } | 1016 } |
1016 | 1017 |
1017 in_paint_layer_contents_ = false; | 1018 in_paint_layer_contents_ = false; |
1018 } | 1019 } |
1019 | 1020 |
1020 void LayerTreeHost::ApplyScrollAndScale(const ScrollAndScaleSet& info) { | 1021 void LayerTreeHost::ApplyScrollAndScale(const ScrollAndScaleSet& info) { |
1021 if (!root_layer_.get()) | 1022 if (!root_layer_.get()) |
1022 return; | 1023 return; |
1023 | 1024 |
1025 for (size_t i = 0; i < info.latency_infos.size(); ++i) { | |
1026 ui::LatencyInfo latency_info = info.latency_infos[i]; | |
1027 TRACE_EVENT_FLOW_STEP0("input", | |
1028 "LatencyInfo.Flow", | |
1029 TRACE_ID_DONT_MANGLE(latency_info.trace_id), | |
1030 "Blink scroll update"); | |
danakj
2014/07/08 16:49:07
layering violation: cc doesn't know about blink. Y
Sami
2014/07/09 13:28:55
Ah, sorry for the slip-up :) Fixed.
| |
1031 scoped_ptr<SwapPromise> swap_promise( | |
1032 new LatencyInfoSwapPromise(latency_info)); | |
1033 QueueSwapPromise(swap_promise.Pass()); | |
1034 } | |
1035 | |
1024 gfx::Vector2d inner_viewport_scroll_delta; | 1036 gfx::Vector2d inner_viewport_scroll_delta; |
1025 gfx::Vector2d outer_viewport_scroll_delta; | 1037 gfx::Vector2d outer_viewport_scroll_delta; |
1026 | 1038 |
1027 for (size_t i = 0; i < info.scrolls.size(); ++i) { | 1039 for (size_t i = 0; i < info.scrolls.size(); ++i) { |
1028 Layer* layer = | 1040 Layer* layer = |
1029 LayerTreeHostCommon::FindLayerInSubtree(root_layer_.get(), | 1041 LayerTreeHostCommon::FindLayerInSubtree(root_layer_.get(), |
1030 info.scrolls[i].layer_id); | 1042 info.scrolls[i].layer_id); |
1031 if (!layer) | 1043 if (!layer) |
1032 continue; | 1044 continue; |
1033 if (layer == outer_viewport_scroll_layer_.get()) { | 1045 if (layer == outer_viewport_scroll_layer_.get()) { |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1272 swap_promise_list_.push_back(swap_promise.Pass()); | 1284 swap_promise_list_.push_back(swap_promise.Pass()); |
1273 } | 1285 } |
1274 | 1286 |
1275 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1287 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
1276 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1288 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
1277 swap_promise_list_[i]->DidNotSwap(reason); | 1289 swap_promise_list_[i]->DidNotSwap(reason); |
1278 swap_promise_list_.clear(); | 1290 swap_promise_list_.clear(); |
1279 } | 1291 } |
1280 | 1292 |
1281 } // namespace cc | 1293 } // namespace cc |
OLD | NEW |