chromium/third_party/angle/src/common/debug.cpp

//
// Copyright 2002 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.
//

// debug.cpp: Debugging utilities.

#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

namespace priv
{

bool ShouldCreatePlatformLogMessage(LogSeverity severity)
{}

// This is never instantiated, it's just used for EAT_STREAM_PARAMETERS to an object of the correct
// type on the LHS of the unused part of the ternary operator.
std::ostream *gSwallowStream;
}  // namespace priv

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  // defined(ANGLE_PLATFORM_WINDOWS)

}  // namespace gl