1 // Copyright 2013 The Chromium Authors. All rights reserved.
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_DEVTOOLS_INSTRUMENTATION_H_
6 #define CC_DEVTOOLS_INSTRUMENTATION_H_
8 #include "base/debug/trace_event.h"
11 namespace devtools_instrumentation
{
14 const char kCategory
[] = "cc,devtools";
15 const char kLayerId
[] = "layerId";
16 const char kPaintLayer
[] = "PaintLayer";
17 const char kRasterTask
[] = "RasterTask";
20 struct ScopedPaintLayer
22 ScopedPaintLayer(int layer_id
) {
23 TRACE_EVENT_BEGIN1(internal::kCategory
, internal::kPaintLayer
,
24 internal::kLayerId
, layer_id
);
27 TRACE_EVENT_END0(internal::kCategory
, internal::kPaintLayer
);
31 struct ScopedRasterTask
33 ScopedRasterTask(int layer_id
) {
34 TRACE_EVENT_BEGIN1(internal::kCategory
, internal::kRasterTask
,
35 internal::kLayerId
, layer_id
);
38 TRACE_EVENT_END0(internal::kCategory
, internal::kRasterTask
);
42 struct ScopedLayerObjectTracker
43 : public base::debug::TraceScopedTrackableObject
<int>
45 ScopedLayerObjectTracker(int layer_id
)
46 : base::debug::TraceScopedTrackableObject
<int>(