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

Side by Side Diff: cc/debug/frame_viewer_instrumentation.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: review comments addressed 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/debug/frame_viewer_instrumentation.h" 5 #include "cc/debug/frame_viewer_instrumentation.h"
6 6
7 #include "cc/trees/layer_tree_host_impl.h"
8
7 namespace cc { 9 namespace cc {
8 namespace frame_viewer_instrumentation { 10 namespace frame_viewer_instrumentation {
9 namespace { 11 namespace {
10 12
11 const char kCategory[] = "cc," TRACE_DISABLED_BY_DEFAULT("devtools.timeline"); 13 const char kCategory[] = "cc," TRACE_DISABLED_BY_DEFAULT("devtools.timeline");
14 const char kCategoryLayerTree[] =
15 TRACE_DISABLED_BY_DEFAULT("cc.debug") ","
16 TRACE_DISABLED_BY_DEFAULT("cc.debug.quads") ","
17 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.layers");
18
12 const char kTileData[] = "tileData"; 19 const char kTileData[] = "tileData";
13 const char kLayerId[] = "layerId"; 20 const char kLayerId[] = "layerId";
14 const char kTileId[] = "tileId"; 21 const char kTileId[] = "tileId";
15 const char kTileResolution[] = "tileResolution"; 22 const char kTileResolution[] = "tileResolution";
16 const char kSourceFrameNumber[] = "sourceFrameNumber"; 23 const char kSourceFrameNumber[] = "sourceFrameNumber";
17 24
18 const char kAnalyzeTask[] = "AnalyzeTask"; 25 const char kAnalyzeTask[] = "AnalyzeTask";
19 const char kRasterTask[] = "RasterTask"; 26 const char kRasterTask[] = "RasterTask";
20 27
21 scoped_refptr<base::trace_event::ConvertableToTraceFormat> TileDataAsValue( 28 scoped_refptr<base::trace_event::ConvertableToTraceFormat> TileDataAsValue(
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 int layer_id) { 60 int layer_id) {
54 TRACE_EVENT_BEGIN1( 61 TRACE_EVENT_BEGIN1(
55 kCategory, kRasterTask, kTileData, 62 kCategory, kRasterTask, kTileData,
56 TileDataAsValue(tile_id, tile_resolution, source_frame_number, layer_id)); 63 TileDataAsValue(tile_id, tile_resolution, source_frame_number, layer_id));
57 } 64 }
58 65
59 ScopedRasterTask::~ScopedRasterTask() { 66 ScopedRasterTask::~ScopedRasterTask() {
60 TRACE_EVENT_END0(kCategory, kRasterTask); 67 TRACE_EVENT_END0(kCategory, kRasterTask);
61 } 68 }
62 69
70 bool IsTracingLayerTreeSnapshots() {
71 bool category_enabled;
72 TRACE_EVENT_CATEGORY_GROUP_ENABLED(kCategoryLayerTree, &category_enabled);
73 return category_enabled;
74 }
75
76 void TraceLayerTreeSnapshot(LayerTreeHostImpl* layer_tree_host_impl,
77 FrameData* frame) {
78 TRACE_EVENT0("cc", "DrawLayers.FrameViewerTracing");
danakj 2015/03/16 19:06:49 Can you make this trace event name more like the f
79 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(
80 kCategoryLayerTree, "cc::LayerTreeHostImpl", layer_tree_host_impl->id(),
81 layer_tree_host_impl->AsValueWithFrame(frame));
82 }
83
63 } // namespace frame_viewer_instrumentation 84 } // namespace frame_viewer_instrumentation
64 } // namespace cc 85 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698