1 // Copyright 2014 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_TILES_FRAME_VIEWER_INSTRUMENTATION_H_
6 #define CC_TILES_FRAME_VIEWER_INSTRUMENTATION_H_
8 #include "base/trace_event/trace_event.h"
9 #include "cc/cc_export.h"
10 #include "cc/tiles/tile_priority.h"
13 namespace frame_viewer_instrumentation {
15 constexpr const char* CategoryLayerTree() {
16 // Declared as a constexpr function to have an external linkage and to be
17 // known at compile-time.
18 return TRACE_DISABLED_BY_DEFAULT("cc.debug") "," TRACE_DISABLED_BY_DEFAULT(
19 "viz.quads") "," TRACE_DISABLED_BY_DEFAULT("devtools.timeline.layers");
22 class ScopedAnalyzeTask {
24 ScopedAnalyzeTask(const void* tile_id,
25 TileResolution tile_resolution,
26 int source_frame_number,
28 ScopedAnalyzeTask(const ScopedAnalyzeTask&) = delete;
31 ScopedAnalyzeTask& operator=(const ScopedAnalyzeTask&) = delete;
34 class ScopedRasterTask {
36 ScopedRasterTask(const void* tile_id,
37 TileResolution tile_resolution,
38 int source_frame_number,
40 ScopedRasterTask(const ScopedRasterTask&) = delete;
43 ScopedRasterTask& operator=(const ScopedRasterTask&) = delete;
46 bool CC_EXPORT IsTracingLayerTreeSnapshots();
48 } // namespace frame_viewer_instrumentation
51 #endif // CC_TILES_FRAME_VIEWER_INSTRUMENTATION_H_