| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkEventTracer_DEFINED | 8 #ifndef SkEventTracer_DEFINED |
| 9 #define SkEventTracer_DEFINED | 9 #define SkEventTracer_DEFINED |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // to explicitly enable the event. | 22 // to explicitly enable the event. |
| 23 #define TRACE_DISABLED_BY_DEFAULT(name) "disabled-by-default-" name | 23 #define TRACE_DISABLED_BY_DEFAULT(name) "disabled-by-default-" name |
| 24 | 24 |
| 25 class SK_API SkEventTracer { | 25 class SK_API SkEventTracer { |
| 26 public: | 26 public: |
| 27 | 27 |
| 28 typedef uint64_t Handle; | 28 typedef uint64_t Handle; |
| 29 | 29 |
| 30 static SkEventTracer* GetInstance(); | 30 static SkEventTracer* GetInstance(); |
| 31 | 31 |
| 32 static void SetInstance(SkEventTracer* tracer) { | 32 static void SetInstance(SkEventTracer*); |
| 33 SkDELETE(SkEventTracer::gInstance); | |
| 34 SkEventTracer::gInstance = tracer; | |
| 35 } | |
| 36 | 33 |
| 37 virtual ~SkEventTracer() { } | 34 virtual ~SkEventTracer() { } |
| 38 | 35 |
| 39 // The pointer returned from GetCategoryGroupEnabled() points to a | 36 // The pointer returned from GetCategoryGroupEnabled() points to a |
| 40 // value with zero or more of the following bits. Used in this class only. | 37 // value with zero or more of the following bits. Used in this class only. |
| 41 // The TRACE_EVENT macros should only use the value as a bool. | 38 // The TRACE_EVENT macros should only use the value as a bool. |
| 42 // These values must be in sync with macro values in trace_event.h in chromi
um. | 39 // These values must be in sync with macro values in trace_event.h in chromi
um. |
| 43 enum CategoryGroupEnabledFlags { | 40 enum CategoryGroupEnabledFlags { |
| 44 // Category group enabled for the recording mode. | 41 // Category group enabled for the recording mode. |
| 45 kEnabledForRecording_CategoryGroupEnabledFlags = 1 << 0, | 42 kEnabledForRecording_CategoryGroupEnabledFlags = 1 << 0, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 61 int32_t numArgs, | 58 int32_t numArgs, |
| 62 const char** argNames, | 59 const char** argNames, |
| 63 const uint8_t* argTypes, | 60 const uint8_t* argTypes, |
| 64 const uint64_t* argValues, | 61 const uint64_t* argValues, |
| 65 uint8_t flags) = 0; | 62 uint8_t flags) = 0; |
| 66 | 63 |
| 67 virtual void | 64 virtual void |
| 68 updateTraceEventDuration(const uint8_t* categoryEnabledFlag, | 65 updateTraceEventDuration(const uint8_t* categoryEnabledFlag, |
| 69 const char* name, | 66 const char* name, |
| 70 SkEventTracer::Handle handle) = 0; | 67 SkEventTracer::Handle handle) = 0; |
| 71 private: | |
| 72 static SkEventTracer *gInstance; | |
| 73 }; | 68 }; |
| 74 | 69 |
| 75 #endif // SkEventTracer_DEFINED | 70 #endif // SkEventTracer_DEFINED |
| OLD | NEW |