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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 } | 262 } |
| 262 | 263 |
| 263 host_impl->set_max_memory_needed_bytes( | 264 host_impl->set_max_memory_needed_bytes( |
| 264 contents_texture_manager_->MaxMemoryNeededBytes()); | 265 contents_texture_manager_->MaxMemoryNeededBytes()); |
| 265 | 266 |
| 266 contents_texture_manager_->UpdateBackingsState( | 267 contents_texture_manager_->UpdateBackingsState( |
| 267 host_impl->resource_provider()); | 268 host_impl->resource_provider()); |
| 268 contents_texture_manager_->ReduceMemory(host_impl->resource_provider()); | 269 contents_texture_manager_->ReduceMemory(host_impl->resource_provider()); |
| 269 } | 270 } |
| 270 | 271 |
| 272 bool is_new_trace; | |
| 273 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); | |
| 274 if (is_new_trace && | |
|
danakj
2015/03/17 17:08:53
I think you need if (root_layer()) as well here.
caseq
2015/03/17 17:44:55
Thanks, done!
FWIW we seem to unconditionally arri
danakj
2015/03/17 18:36:05
I think it does an early out: https://code.google.
| |
| 275 frame_viewer_instrumentation::IsTracingLayerTreeSnapshots()) { | |
| 276 LayerTreeHostCommon::CallFunctionForSubtree( | |
| 277 root_layer(), [](Layer* layer) { layer->DidBeginTracing(); }); | |
| 278 } | |
| 279 | |
| 271 LayerTreeImpl* sync_tree = host_impl->sync_tree(); | 280 LayerTreeImpl* sync_tree = host_impl->sync_tree(); |
| 272 | 281 |
| 273 if (next_commit_forces_redraw_) { | 282 if (next_commit_forces_redraw_) { |
| 274 sync_tree->ForceRedrawNextActivation(); | 283 sync_tree->ForceRedrawNextActivation(); |
| 275 next_commit_forces_redraw_ = false; | 284 next_commit_forces_redraw_ = false; |
| 276 } | 285 } |
| 277 | 286 |
| 278 sync_tree->set_source_frame_number(source_frame_number()); | 287 sync_tree->set_source_frame_number(source_frame_number()); |
| 279 | 288 |
| 280 if (needs_full_tree_sync_) { | 289 if (needs_full_tree_sync_) { |
| (...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1254 bool children_need_begin_frames) const { | 1263 bool children_need_begin_frames) const { |
| 1255 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); | 1264 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); |
| 1256 } | 1265 } |
| 1257 | 1266 |
| 1258 void LayerTreeHost::SendBeginFramesToChildren( | 1267 void LayerTreeHost::SendBeginFramesToChildren( |
| 1259 const BeginFrameArgs& args) const { | 1268 const BeginFrameArgs& args) const { |
| 1260 client_->SendBeginFramesToChildren(args); | 1269 client_->SendBeginFramesToChildren(args); |
| 1261 } | 1270 } |
| 1262 | 1271 |
| 1263 } // namespace cc | 1272 } // namespace cc |
| OLD | NEW |