Index: cc/debug/frame_viewer_instrumentation.cc |
diff --git a/cc/debug/frame_viewer_instrumentation.cc b/cc/debug/frame_viewer_instrumentation.cc |
index 53c155166b8b3f5f21549d12e88e226945b606d8..8efc7e7680a07e4d532ce7e8d96174ce94532354 100644 |
--- a/cc/debug/frame_viewer_instrumentation.cc |
+++ b/cc/debug/frame_viewer_instrumentation.cc |
@@ -4,11 +4,18 @@ |
#include "cc/debug/frame_viewer_instrumentation.h" |
+#include "cc/trees/layer_tree_host_impl.h" |
+ |
namespace cc { |
namespace frame_viewer_instrumentation { |
namespace { |
const char kCategory[] = "cc," TRACE_DISABLED_BY_DEFAULT("devtools.timeline"); |
+const char kCategoryLayerTree[] = |
+ TRACE_DISABLED_BY_DEFAULT("cc.debug") "," |
+ TRACE_DISABLED_BY_DEFAULT("cc.debug.quads") "," |
+ TRACE_DISABLED_BY_DEFAULT("devtools.timeline.layers"); |
+ |
const char kTileData[] = "tileData"; |
const char kLayerId[] = "layerId"; |
const char kTileId[] = "tileId"; |
@@ -60,5 +67,19 @@ ScopedRasterTask::~ScopedRasterTask() { |
TRACE_EVENT_END0(kCategory, kRasterTask); |
} |
+bool IsTracingLayerTreeSnapshots() { |
+ bool category_enabled; |
+ TRACE_EVENT_CATEGORY_GROUP_ENABLED(kCategoryLayerTree, &category_enabled); |
+ return category_enabled; |
+} |
+ |
+void TraceLayerTreeSnapshot(LayerTreeHostImpl* layer_tree_host_impl, |
+ FrameData* frame) { |
+ TRACE_EVENT0("cc", "DrawLayers.FrameViewerTracing"); |
danakj
2015/03/16 19:06:49
Can you make this trace event name more like the f
|
+ TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( |
+ kCategoryLayerTree, "cc::LayerTreeHostImpl", layer_tree_host_impl->id(), |
+ layer_tree_host_impl->AsValueWithFrame(frame)); |
+} |
+ |
} // namespace frame_viewer_instrumentation |
} // namespace cc |