Chromium Code Reviews| Index: cc/trees/layer_tree_host.cc |
| diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc |
| index 12d81f385af026ede4c84fe9fe22246fa492af4d..4ffc04f154941d8cfb5766b814e765597210a957 100644 |
| --- a/cc/trees/layer_tree_host.cc |
| +++ b/cc/trees/layer_tree_host.cc |
| @@ -18,6 +18,7 @@ |
| #include "cc/animation/layer_animation_controller.h" |
| #include "cc/base/math_util.h" |
| #include "cc/debug/benchmark_instrumentation.h" |
| +#include "cc/debug/devtools_instrumentation.h" |
| #include "cc/debug/overdraw_metrics.h" |
| #include "cc/debug/rendering_stats_instrumentation.h" |
| #include "cc/input/top_controls_manager.h" |
| @@ -73,6 +74,8 @@ scoped_ptr<LayerTreeHost> LayerTreeHost::Create( |
| return layer_tree_host.Pass(); |
| } |
| +static int s_next_tree_id = 1; |
| + |
| LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client, |
| const LayerTreeSettings& settings) |
| : animating_(false), |
| @@ -101,7 +104,9 @@ LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client, |
| if (settings_.accelerated_animation_enabled) |
| animation_registrar_ = AnimationRegistrar::Create(); |
| s_num_layer_tree_instances++; |
| - |
| + if (s_next_tree_id <= 0) |
|
jamesr
2013/07/22 18:01:02
what is this for? are you expecting to allocate mo
caseq
2013/07/22 18:56:47
This was mindlessly copied from layer.cc per Nat's
|
| + s_next_tree_id = 1; |
| + tree_id_ = s_next_tree_id++; |
| rendering_stats_instrumentation_->set_record_rendering_stats( |
| debug_state_.RecordRenderingStats()); |
| } |
| @@ -883,6 +888,10 @@ void LayerTreeHost::PaintMasksForRenderSurface(Layer* render_surface_layer, |
| Layer* mask_layer = render_surface_layer->mask_layer(); |
| if (mask_layer) { |
| + devtools_instrumentation::ScopedLayerTreeTask |
|
danakj
2013/07/22 15:06:51
Just wondering: Does devtools have the ability to
caseq
2013/07/22 15:44:49
Yes.
|
| + update_layer(devtools_instrumentation::kUpdateLayer, |
| + mask_layer->id(), |
| + id()); |
| *did_paint_content |= mask_layer->Update(queue, NULL); |
| *need_more_updates |= mask_layer->NeedMoreUpdates(); |
| } |
| @@ -891,6 +900,10 @@ void LayerTreeHost::PaintMasksForRenderSurface(Layer* render_surface_layer, |
| render_surface_layer->replica_layer() ? |
| render_surface_layer->replica_layer()->mask_layer() : NULL; |
| if (replica_mask_layer) { |
| + devtools_instrumentation::ScopedLayerTreeTask |
| + update_layer(devtools_instrumentation::kUpdateLayer, |
| + replica_mask_layer->id(), |
| + id()); |
| *did_paint_content |= replica_mask_layer->Update(queue, NULL); |
| *need_more_updates |= replica_mask_layer->NeedMoreUpdates(); |
| } |
| @@ -934,6 +947,8 @@ void LayerTreeHost::PaintLayerContents( |
| PaintMasksForRenderSurface( |
| *it, queue, did_paint_content, need_more_updates); |
| } else if (it.represents_itself()) { |
| + devtools_instrumentation::ScopedLayerTreeTask |
| + update_layer(devtools_instrumentation::kUpdateLayer, it->id(), id()); |
| DCHECK(!it->paint_properties().bounds.IsEmpty()); |
| *did_paint_content |= it->Update(queue, &occlusion_tracker); |
| *need_more_updates |= it->NeedMoreUpdates(); |