#include "common/debug.h"
#include <stdarg.h>
#include <array>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <ostream>
#include <vector>
#if defined(ANGLE_PLATFORM_ANDROID)
# include <android/log.h>
#endif
#if defined(ANGLE_PLATFORM_APPLE)
# include <os/log.h>
#endif
#if defined(ANGLE_PLATFORM_WINDOWS)
# include <windows.h>
#endif
#include "anglebase/no_destructor.h"
#include "common/Optional.h"
#include "common/SimpleMutex.h"
#include "common/angleutils.h"
#include "common/entry_points_enum_autogen.h"
#include "common/system_utils.h"
namespace gl
{
namespace
{
DebugAnnotator *g_debugAnnotator = …;
angle::SimpleMutex *g_debugMutex = …;
constexpr std::array<const char *, LOG_NUM_SEVERITIES> g_logSeverityNames = …;
constexpr const char *LogSeverityName(int severity)
{ … }
bool ShouldCreateLogMessage(LogSeverity severity)
{ … }
}
namespace priv
{
bool ShouldCreatePlatformLogMessage(LogSeverity severity)
{ … }
std::ostream *gSwallowStream;
}
bool DebugAnnotationsActive(const gl::Context *context)
{ … }
bool ShouldBeginScopedEvent(const gl::Context *context)
{ … }
bool DebugAnnotationsInitialized()
{ … }
void InitializeDebugAnnotations(DebugAnnotator *debugAnnotator)
{ … }
void UninitializeDebugAnnotations()
{ … }
void InitializeDebugMutexIfNeeded()
{ … }
angle::SimpleMutex &GetDebugMutex()
{ … }
ScopedPerfEventHelper::ScopedPerfEventHelper(gl::Context *context, angle::EntryPoint entryPoint)
: … { … }
ScopedPerfEventHelper::~ScopedPerfEventHelper()
{ … }
void ScopedPerfEventHelper::begin(const char *format, ...)
{ … }
LogMessage::LogMessage(const char *file, const char *function, int line, LogSeverity severity)
: … { … }
LogMessage::~LogMessage()
{ … }
void Trace(LogSeverity severity, const char *message)
{ … }
LogSeverity LogMessage::getSeverity() const
{ … }
std::string LogMessage::getMessage() const
{ … }
#if defined(ANGLE_PLATFORM_WINDOWS)
priv::FmtHexHelper<HRESULT, char> FmtHR(HRESULT value)
{
return priv::FmtHexHelper<HRESULT, char>("HRESULT: ", value);
}
priv::FmtHexHelper<DWORD, char> FmtErr(DWORD value)
{
return priv::FmtHexHelper<DWORD, char>("error: ", value);
}
#endif
}