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

Unified Diff: cc/resources/picture.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: address enne feedback 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.h ('k') | cc/resources/picture_pile_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture.cc
diff --git a/cc/resources/picture.cc b/cc/resources/picture.cc
index b0f3fa30e59f0587759f402efd64fd6fe71392da..102e8b7dd20e40513990047cfc6322961b43035d 100644
--- a/cc/resources/picture.cc
+++ b/cc/resources/picture.cc
@@ -225,8 +225,7 @@ void Picture::CloneForDrawing(int num_threads) {
pixel_refs_));
clones_.push_back(clone);
- TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("cc.debug"),
- "cc::Picture", clone.get(), TracedPicture::AsTraceablePicture(clone));
+ clone->EmitTraceSnapshot();
}
}
@@ -273,8 +272,7 @@ void Picture::Record(ContentLayerClient* painter,
opaque_rect_ = gfx::ToEnclosedRect(opaque_layer_rect);
- TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("cc.debug"),
- "cc::Picture", this, TracedPicture::AsTraceablePicture(this));
+ EmitTraceSnapshot();
}
void Picture::GatherPixelRefs(
@@ -388,6 +386,10 @@ scoped_ptr<Value> Picture::AsValue() const {
return res.PassAs<base::Value>();
}
+void Picture::DidBeginTracing() {
enne (OOO) 2013/06/01 03:10:45 I'm not sure this function really needs to exist.
+ EmitTraceSnapshot();
+}
+
base::LazyInstance<Picture::PixelRefs>
Picture::PixelRefIterator::empty_pixel_refs_;
@@ -498,4 +500,9 @@ scoped_ptr<base::debug::ConvertableToTraceFormat>
return TracedValue::FromValue(raster_data.release());
}
+void Picture::EmitTraceSnapshot() {
+ TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("cc.debug"),
+ "cc::Picture", this, TracedPicture::AsTraceablePicture(this));
+}
+
} // namespace cc
« no previous file with comments | « cc/resources/picture.h ('k') | cc/resources/picture_pile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698