Chromium Code Reviews| 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/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 16 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
| 17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/trace_event/trace_event.h" | 18 #include "base/trace_event/trace_event.h" |
| 19 #include "base/trace_event/trace_event_argument.h" | 19 #include "base/trace_event/trace_event_argument.h" |
| 20 #include "cc/animation/animation_registrar.h" | 20 #include "cc/animation/animation_registrar.h" |
| 21 #include "cc/animation/layer_animation_controller.h" | 21 #include "cc/animation/layer_animation_controller.h" |
| 22 #include "cc/base/math_util.h" | 22 #include "cc/base/math_util.h" |
| 23 #include "cc/debug/devtools_instrumentation.h" | 23 #include "cc/debug/devtools_instrumentation.h" |
| 24 #include "cc/debug/frame_viewer_instrumentation.h" | |
| 24 #include "cc/debug/rendering_stats_instrumentation.h" | 25 #include "cc/debug/rendering_stats_instrumentation.h" |
| 25 #include "cc/input/layer_selection_bound.h" | 26 #include "cc/input/layer_selection_bound.h" |
| 26 #include "cc/input/page_scale_animation.h" | 27 #include "cc/input/page_scale_animation.h" |
| 27 #include "cc/input/top_controls_manager.h" | 28 #include "cc/input/top_controls_manager.h" |
| 28 #include "cc/layers/heads_up_display_layer.h" | 29 #include "cc/layers/heads_up_display_layer.h" |
| 29 #include "cc/layers/heads_up_display_layer_impl.h" | 30 #include "cc/layers/heads_up_display_layer_impl.h" |
| 30 #include "cc/layers/layer.h" | 31 #include "cc/layers/layer.h" |
| 31 #include "cc/layers/layer_iterator.h" | 32 #include "cc/layers/layer_iterator.h" |
| 32 #include "cc/layers/painted_scrollbar_layer.h" | 33 #include "cc/layers/painted_scrollbar_layer.h" |
| 33 #include "cc/layers/render_surface.h" | 34 #include "cc/layers/render_surface.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 287 | 288 |
| 288 LayerTreeImpl* sync_tree = host_impl->sync_tree(); | 289 LayerTreeImpl* sync_tree = host_impl->sync_tree(); |
| 289 | 290 |
| 290 if (next_commit_forces_redraw_) { | 291 if (next_commit_forces_redraw_) { |
| 291 sync_tree->ForceRedrawNextActivation(); | 292 sync_tree->ForceRedrawNextActivation(); |
| 292 next_commit_forces_redraw_ = false; | 293 next_commit_forces_redraw_ = false; |
| 293 } | 294 } |
| 294 | 295 |
| 295 sync_tree->set_source_frame_number(source_frame_number()); | 296 sync_tree->set_source_frame_number(source_frame_number()); |
| 296 | 297 |
| 298 bool is_new_trace; | |
|
danakj
2015/03/16 19:06:49
Can you move this up above the |sync_tree| variabl
| |
| 299 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); | |
| 300 if (is_new_trace && | |
| 301 frame_viewer_instrumentation::IsTracingLayerTreeSnapshots()) { | |
| 302 LayerTreeHostCommon::CallFunctionForSubtree( | |
| 303 root_layer(), [](Layer* layer) { layer->DidBeginTracing(); }); | |
| 304 } | |
| 305 | |
| 297 if (needs_full_tree_sync_) { | 306 if (needs_full_tree_sync_) { |
| 298 sync_tree->SetRootLayer(TreeSynchronizer::SynchronizeTrees( | 307 sync_tree->SetRootLayer(TreeSynchronizer::SynchronizeTrees( |
| 299 root_layer(), sync_tree->DetachLayerTree(), sync_tree)); | 308 root_layer(), sync_tree->DetachLayerTree(), sync_tree)); |
| 300 } | 309 } |
| 301 sync_tree->set_needs_full_tree_sync(needs_full_tree_sync_); | 310 sync_tree->set_needs_full_tree_sync(needs_full_tree_sync_); |
| 302 needs_full_tree_sync_ = false; | 311 needs_full_tree_sync_ = false; |
| 303 | 312 |
| 304 if (hud_layer_.get()) { | 313 if (hud_layer_.get()) { |
| 305 LayerImpl* hud_impl = LayerTreeHostCommon::FindLayerInSubtree( | 314 LayerImpl* hud_impl = LayerTreeHostCommon::FindLayerInSubtree( |
| 306 sync_tree->root_layer(), hud_layer_->id()); | 315 sync_tree->root_layer(), hud_layer_->id()); |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1271 bool children_need_begin_frames) const { | 1280 bool children_need_begin_frames) const { |
| 1272 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); | 1281 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); |
| 1273 } | 1282 } |
| 1274 | 1283 |
| 1275 void LayerTreeHost::SendBeginFramesToChildren( | 1284 void LayerTreeHost::SendBeginFramesToChildren( |
| 1276 const BeginFrameArgs& args) const { | 1285 const BeginFrameArgs& args) const { |
| 1277 client_->SendBeginFramesToChildren(args); | 1286 client_->SendBeginFramesToChildren(args); |
| 1278 } | 1287 } |
| 1279 | 1288 |
| 1280 } // namespace cc | 1289 } // namespace cc |
| OLD | NEW |