diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /gfx/angle/src/common/event_tracer.cpp | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'gfx/angle/src/common/event_tracer.cpp')
-rwxr-xr-x | gfx/angle/src/common/event_tracer.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/gfx/angle/src/common/event_tracer.cpp b/gfx/angle/src/common/event_tracer.cpp new file mode 100755 index 000000000..c9eb5e307 --- /dev/null +++ b/gfx/angle/src/common/event_tracer.cpp @@ -0,0 +1,56 @@ +// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "common/event_tracer.h" + +#include "common/debug.h" + +namespace angle +{ + +const unsigned char *GetTraceCategoryEnabledFlag(const char *name) +{ + angle::Platform *platform = ANGLEPlatformCurrent(); + ASSERT(platform); + + const unsigned char *categoryEnabledFlag = platform->getTraceCategoryEnabledFlag(name); + if (categoryEnabledFlag != nullptr) + { + return categoryEnabledFlag; + } + + static unsigned char disabled = 0; + return &disabled; +} + +Platform::TraceEventHandle AddTraceEvent(char phase, const unsigned char* categoryGroupEnabled, const char* name, unsigned long long id, + int numArgs, const char** argNames, const unsigned char* argTypes, + const unsigned long long* argValues, unsigned char flags) +{ + angle::Platform *platform = ANGLEPlatformCurrent(); + ASSERT(platform); + + double timestamp = platform->monotonicallyIncreasingTime(); + + if (timestamp != 0) + { + angle::Platform::TraceEventHandle handle = + platform->addTraceEvent(phase, + categoryGroupEnabled, + name, + id, + timestamp, + numArgs, + argNames, + argTypes, + argValues, + flags); + ASSERT(handle != 0); + return handle; + } + + return static_cast<Platform::TraceEventHandle>(0); +} + +} // namespace angle |