| OLD | NEW |
| 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 "base/debug/trace_event.h" | 5 #include "base/debug/trace_event.h" |
| 6 #include "skia/ext/event_tracer_impl.h" | 6 #include "skia/ext/event_tracer_impl.h" |
| 7 #include "third_party/skia/include/utils/SkEventTracer.h" | 7 #include "third_party/skia/include/utils/SkEventTracer.h" |
| 8 | 8 |
| 9 namespace skia { | 9 namespace skia { |
| 10 | 10 |
| 11 class SkChromiumEventTracer: public SkEventTracer { | 11 class SkChromiumEventTracer: public SkEventTracer { |
| 12 virtual const uint8_t* getCategoryGroupEnabled(const char* name) override; | 12 const uint8_t* getCategoryGroupEnabled(const char* name) override; |
| 13 virtual const char* getCategoryGroupName( | 13 const char* getCategoryGroupName(const uint8_t* categoryEnabledFlag) override; |
| 14 const uint8_t* categoryEnabledFlag) override; | 14 SkEventTracer::Handle addTraceEvent(char phase, |
| 15 virtual SkEventTracer::Handle | 15 const uint8_t* categoryEnabledFlag, |
| 16 addTraceEvent(char phase, | 16 const char* name, |
| 17 const uint8_t* categoryEnabledFlag, | 17 uint64_t id, |
| 18 const char* name, | 18 int32_t numArgs, |
| 19 uint64_t id, | 19 const char** argNames, |
| 20 int32_t numArgs, | 20 const uint8_t* argTypes, |
| 21 const char** argNames, | 21 const uint64_t* argValues, |
| 22 const uint8_t* argTypes, | 22 uint8_t flags) override; |
| 23 const uint64_t* argValues, | 23 void updateTraceEventDuration(const uint8_t* categoryEnabledFlag, |
| 24 uint8_t flags) override; | 24 const char* name, |
| 25 virtual void | 25 SkEventTracer::Handle handle) override; |
| 26 updateTraceEventDuration(const uint8_t* categoryEnabledFlag, | |
| 27 const char *name, | |
| 28 SkEventTracer::Handle handle) override; | |
| 29 }; | 26 }; |
| 30 | 27 |
| 31 const uint8_t* | 28 const uint8_t* |
| 32 SkChromiumEventTracer::getCategoryGroupEnabled(const char* name) { | 29 SkChromiumEventTracer::getCategoryGroupEnabled(const char* name) { |
| 33 return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(name); | 30 return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(name); |
| 34 } | 31 } |
| 35 | 32 |
| 36 const char* SkChromiumEventTracer::getCategoryGroupName( | 33 const char* SkChromiumEventTracer::getCategoryGroupName( |
| 37 const uint8_t* categoryEnabledFlag) { | 34 const uint8_t* categoryEnabledFlag) { |
| 38 return base::debug::TraceLog::GetCategoryGroupName( | 35 return base::debug::TraceLog::GetCategoryGroupName( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 69 } | 66 } |
| 70 | 67 |
| 71 } // namespace skia | 68 } // namespace skia |
| 72 | 69 |
| 73 | 70 |
| 74 void InitSkiaEventTracer() { | 71 void InitSkiaEventTracer() { |
| 75 // Initialize the binding to Skia's tracing events. Skia will | 72 // Initialize the binding to Skia's tracing events. Skia will |
| 76 // take ownership of and clean up the memory allocated here. | 73 // take ownership of and clean up the memory allocated here. |
| 77 SkEventTracer::SetInstance(new skia::SkChromiumEventTracer()); | 74 SkEventTracer::SetInstance(new skia::SkChromiumEventTracer()); |
| 78 } | 75 } |
| OLD | NEW |