Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Unified Diff: cc/trees/layer_tree_host.cc

Issue 924973003: CC: Force push properties for all layers when tracing is started (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Introduce Layer::DidBeginTracing(), call SetNeedsPushProperties() from there Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« cc/layers/layer.cc ('K') | « cc/layers/layer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« cc/layers/layer.cc ('K') | « cc/layers/layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698