[M108 Migration][VD] Avoid pending frame counter becoming negative
[platform/framework/web/chromium-efl.git] / cc / tiles / frame_viewer_instrumentation.h
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.
4
5 #ifndef CC_TILES_FRAME_VIEWER_INSTRUMENTATION_H_
6 #define CC_TILES_FRAME_VIEWER_INSTRUMENTATION_H_
7
8 #include "base/trace_event/trace_event.h"
9 #include "cc/cc_export.h"
10 #include "cc/tiles/tile_priority.h"
11
12 namespace cc {
13 namespace frame_viewer_instrumentation {
14
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");
20 }
21
22 class ScopedAnalyzeTask {
23  public:
24   ScopedAnalyzeTask(const void* tile_id,
25                     TileResolution tile_resolution,
26                     int source_frame_number,
27                     int layer_id);
28   ScopedAnalyzeTask(const ScopedAnalyzeTask&) = delete;
29   ~ScopedAnalyzeTask();
30
31   ScopedAnalyzeTask& operator=(const ScopedAnalyzeTask&) = delete;
32 };
33
34 class ScopedRasterTask {
35  public:
36   ScopedRasterTask(const void* tile_id,
37                    TileResolution tile_resolution,
38                    int source_frame_number,
39                    int layer_id);
40   ScopedRasterTask(const ScopedRasterTask&) = delete;
41   ~ScopedRasterTask();
42
43   ScopedRasterTask& operator=(const ScopedRasterTask&) = delete;
44 };
45
46 bool CC_EXPORT IsTracingLayerTreeSnapshots();
47
48 }  // namespace frame_viewer_instrumentation
49 }  // namespace cc
50
51 #endif  // CC_TILES_FRAME_VIEWER_INSTRUMENTATION_H_