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

Unified Diff: cc/layers/layer.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: added root_layer() check Created 5 years, 9 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
« no previous file with comments | « cc/layers/layer.h ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 12773a140768d377b53eb6ff638020191bcae47c..be2d085d7c98e9ac34912bf055aa3e8b00add08f 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -18,6 +18,7 @@
#include "cc/animation/keyframed_animation_curve.h"
#include "cc/animation/layer_animation_controller.h"
#include "cc/base/simple_enclosed_region.h"
+#include "cc/debug/frame_viewer_instrumentation.h"
#include "cc/layers/layer_client.h"
#include "cc/layers/layer_impl.h"
#include "cc/layers/scrollbar_layer_interface.h"
@@ -897,12 +898,7 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
layer->SetContentBounds(content_bounds());
layer->SetContentsScale(contents_scale_x(), contents_scale_y());
- bool is_tracing;
- TRACE_EVENT_CATEGORY_GROUP_ENABLED(
- TRACE_DISABLED_BY_DEFAULT("cc.debug") "," TRACE_DISABLED_BY_DEFAULT(
- "devtools.timeline.layers"),
- &is_tracing);
- if (is_tracing)
+ if (frame_viewer_instrumentation::IsTracingLayerTreeSnapshots())
layer->SetDebugInfo(TakeDebugInfo());
layer->SetDoubleSided(double_sided_);
@@ -1354,4 +1350,12 @@ void Layer::SetFrameTimingRequests(
SetNeedsCommit();
}
+void Layer::DidBeginTracing() {
+ // We'll be dumping layer trees as part of trace, so make sure
+ // PushPropertiesTo() propagates layer debug info to the impl
+ // side -- otherwise this won't happen for the the layers that
+ // remain unchanged since tracing started.
+ SetNeedsPushProperties();
+}
+
} // namespace cc
« no previous file with comments | « cc/layers/layer.h ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698