mirror of
https://github.com/utmapp/angle.git
synced 2026-12-01 22:13:25 -10:00
Now that Chromium is switched to ANGLE's new Platform tracing methods, we can junk the old APIs. BUG=angleproject:966 BUG=436191 Change-Id: Ie2564eed9e5ce4604e0dcd4582618e7467b2d590 Reviewed-on: https://chromium-review.googlesource.com/264934 Tested-by: Jamie Madill <[email protected]> Reviewed-by: Kenneth Russell <[email protected]> Reviewed-by: Brandon Jones <[email protected]>
57 lines
1.8 KiB
C++
57 lines
1.8 KiB
C++
// 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
|