Index: cc/trees/layer_tree_host.cc |
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc |
index abc63fc932eebfd8297d1bd0e020e9c3040b72a1..1e8fb7a833a9ee02b32c41afa80a93f42dfc4b8e 100644 |
--- a/cc/trees/layer_tree_host.cc |
+++ b/cc/trees/layer_tree_host.cc |
@@ -215,6 +215,10 @@ static void LayerTreeHostOnOutputSurfaceCreatedCallback(Layer* layer) { |
layer->OnOutputSurfaceCreated(); |
} |
+static void LayerTreeHostDidBeginTracingCallback(Layer* layer) { |
+ layer->DidBeginTracing(); |
+} |
+ |
void LayerTreeHost::DeleteContentsTexturesOnImplThread( |
ResourceProvider* resource_provider) { |
DCHECK(proxy_->IsImplThread()); |
@@ -298,6 +302,23 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { |
sync_tree->set_source_frame_number(source_frame_number()); |
+ bool is_new_trace; |
+ TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); |
+ if (is_new_trace) { |
+ // We're about to start tracing snaphsots of layer tree, so force |
+ // push properties for all layers to propagate LayerDebugInfo to |
danakj
2015/03/06 18:50:12
I see, LayerDebugInfo is a type, up in ui/composit
|
+ // the impl side. |
+ bool will_snapshot_layer_tree; |
+ TRACE_EVENT_CATEGORY_GROUP_ENABLED( |
+ TRACE_DISABLED_BY_DEFAULT("cc.debug") "," TRACE_DISABLED_BY_DEFAULT( |
danakj
2015/03/06 18:50:12
I don't like that these magic categories appear he
|
+ "devtools.timeline.layers"), |
+ &will_snapshot_layer_tree); |
+ if (will_snapshot_layer_tree) { |
+ LayerTreeHostCommon::CallFunctionForSubtree( |
+ root_layer(), base::Bind(LayerTreeHostDidBeginTracingCallback)); |
danakj
2015/03/06 18:50:12
This will need a rebase.
|
+ } |
+ } |
+ |
if (needs_full_tree_sync_) { |
sync_tree->SetRootLayer(TreeSynchronizer::SynchronizeTrees( |
root_layer(), sync_tree->DetachLayerTree(), sync_tree)); |