| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2014 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. |
| 4 |
| 5 #include "base/debug/trace_event.h" |
| 6 #include "skia/ext/trace_event.h" |
| 7 #include "third_party/skia/include/core/SkDevice.h" |
| 8 |
| 9 namespace skia { |
| 10 |
| 11 const uint8_t* |
| 12 SkChromiumEventTracer::getCategoryGroupEnabled(const char* name) { |
| 13 return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(name); |
| 14 } |
| 15 |
| 16 const char* SkChromiumEventTracer::getCategoryGroupName( |
| 17 const uint8_t* categoryEnabledFlag) { |
| 18 return base::debug::TraceLog::GetCategoryGroupName( |
| 19 categoryEnabledFlag); |
| 20 } |
| 21 |
| 22 SkEventTracer::Handle |
| 23 SkChromiumEventTracer::addTraceEvent(char phase, |
| 24 const uint8_t* categoryEnabledFlag, |
| 25 const char* name, |
| 26 uint64_t id, |
| 27 int32_t numArgs, |
| 28 const char** argNames, |
| 29 const uint8_t* argTypes, |
| 30 const uint64_t* argValues, |
| 31 uint8_t flags) { |
| 32 base::debug::TraceEventHandle handle = TRACE_EVENT_API_ADD_TRACE_EVENT( |
| 33 phase, categoryEnabledFlag, name, id, numArgs, argNames, |
| 34 argTypes, (const long long unsigned int*) argValues, NULL, flags); |
| 35 SkEventTracer::Handle result; |
| 36 memcpy(&result, &handle, sizeof(result)); |
| 37 return result; |
| 38 } |
| 39 |
| 40 void |
| 41 SkChromiumEventTracer::updateTraceEventDuration( |
| 42 const uint8_t* categoryEnabledFlag, |
| 43 const char *name, |
| 44 SkEventTracer::Handle handle) { |
| 45 base::debug::TraceEventHandle traceEventHandle; |
| 46 memcpy(&traceEventHandle, &handle, sizeof(handle)); |
| 47 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( |
| 48 categoryEnabledFlag, name, traceEventHandle); |
| 49 } |
| 50 |
| 51 } // namespace skia |
| 52 |
| OLD | NEW |