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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 15774010: Add TRACE_EVENT_IS_NEW_TRACE as a way to snapshot objects at start of recording (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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/resources/picture_pile_impl.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_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 0dc624d6c4100253af4b363abb2375a00529a3dd..ef2b53dcc00a6cb2bbbf6d8d38bfd3307cfa55c8 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1107,6 +1107,13 @@ bool LayerTreeHostImpl::AllowPartialSwap() const {
return !debug_state_.ShowHudRects();
}
+class DidBeginTracingFunctor {
+ public:
+ void operator()(LayerImpl* layer) {
+ layer->DidBeginTracing();
+ }
+};
+
void LayerTreeHostImpl::DrawLayers(FrameData* frame,
base::TimeTicks frame_begin_time) {
TRACE_EVENT0("cc", "LayerTreeHostImpl::DrawLayers");
@@ -1144,6 +1151,18 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame,
paint_time_counter_->SavePaintTime(stats.total_paint_time);
}
+ bool is_new_trace;
+ TRACE_EVENT_IS_NEW_TRACE(&is_new_trace);
+ if (is_new_trace) {
+ if (pending_tree_)
+ LayerTreeHostCommon::CallFunctionForSubtree<
+ DidBeginTracingFunctor, LayerImpl>(
+ pending_tree_->root_layer());
+ LayerTreeHostCommon::CallFunctionForSubtree<
+ DidBeginTracingFunctor, LayerImpl>(
+ active_tree_->root_layer());
+ }
+
TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(
TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::LayerTreeHostImpl", this,
TracedValue::FromValue(AsValue().release()));
« no previous file with comments | « cc/resources/picture_pile_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698