#ifndef COMPONENTS_VIZ_SERVICE_DEBUGGER_VIZ_DEBUGGER_H_
#define COMPONENTS_VIZ_SERVICE_DEBUGGER_VIZ_DEBUGGER_H_
#include <atomic>
#include <memory>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#include "base/debug/debugging_buildflags.h"
#include "base/macros/concat.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/traced_value.h"
#include "base/values.h"
#include "components/viz/common/buildflags.h"
#include "components/viz/service/debugger/mojom/viz_debugger.mojom.h"
#include "components/viz/service/debugger/rwlock.h"
#include "components/viz/service/viz_service_export.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/vector2d_f.h"
#if BUILDFLAG(USE_VIZ_DEBUGGER)
#define VIZ_DEBUGGER_IS_ON() …
namespace viz {
class VIZ_SERVICE_EXPORT VizDebugger { … };
}
#define DBG_OPT_RED …
#define DBG_OPT_GREEN …
#define DBG_OPT_BLUE …
#define DBG_OPT_BLACK …
#define DBG_DEFAULT_UV …
#define DBG_DRAW_RECTANGLE_OPT_BUFF_UV_TEXT(anno, option, pos, size, id, uv, \
text) …
#define DBG_COMPLETE_BUFFERS(buff_id, buffer) …
#define DBG_LOG_OPT(anno, option, format, ...) …
#define DBG_CONNECTED_OR_TRACING(is_enabled) …
#define DBG_FLAG_FBOOL(anno, fun_name) …
#else
#define VIZ_DEBUGGER_IS_ON …
namespace viz {
class VIZ_SERVICE_EXPORT VizDebugger {
public:
VizDebugger() = default;
static inline VizDebugger* GetInstance() {
static VizDebugger g_debugger;
return &g_debugger;
}
struct VIZ_SERVICE_EXPORT BufferInfo {
BufferInfo();
~BufferInfo();
BufferInfo(const BufferInfo& a);
SkBitmap bitmap;
};
struct DrawOption {
uint8_t color_r;
uint8_t color_g;
uint8_t color_b;
uint8_t color_a;
};
inline void CompleteFrame(uint64_t counter,
const gfx::Size& window_pix,
base::TimeTicks time_ticks) {}
static inline bool IsEnabled() { return false; }
VizDebugger(const VizDebugger&) = delete;
VizDebugger& operator=(const VizDebugger&) = delete;
};
std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
DrawRectToTraceValue(const gfx::Vector2dF& pos,
const gfx::SizeF& size,
const std::string& text);
}
#define VIZ_DEBUGGER_TRACING_CATEGORY …
#define DBG_OPT_RED …
#define DBG_OPT_GREEN …
#define DBG_OPT_BLUE …
#define DBG_OPT_BLACK …
#define DBG_DEFAULT_UV …
#define DBG_VIZ_DEBUGGER_TRACE_IMPL …
#define DBG_DRAW_RECTANGLE_OPT_BUFF_UV_TEXT …
#define DBG_COMPLETE_BUFFERS …
#define DBG_LOG_OPT …
#define DBG_CONNECTED_OR_TRACING …
#define DBG_FLAG_FBOOL …
#endif
#define DBG_DRAW_RECTANGLE_OPT_BUFF_UV(anno, option, pos, size, id, uv) …
#define DBG_DRAW_RECTANGLE_OPT(anno, option, pos, size) …
#define DBG_DRAW_RECTANGLE(anno, pos, size) …
#define DBG_DRAW_RECTANGLE_OPT_BUFF(anno, option, pos, size, id) …
#define DBG_DRAW_RECT_OPT_BUFF(anno, option, rect, id) …
#define DBG_DRAW_RECT_OPT(anno, option, rect) …
#define DBG_DRAW_RECT_BUFF(anno, rect, id) …
#define DBG_DRAW_RECT_BUFF_UV(anno, rect, id, uv) …
#define DBG_DRAW_RECT(anno, rect) …
#define DBG_DRAW_TEXT_OPT(anno, option, pos, text) …
#define DBG_DRAW_TEXT(anno, pos, text) …
#define DBG_LOG(anno, format, ...) …
#define DBG_DRAW_RECT_OPT_BUFF_UV(anno, option, rect, id, uv) …
#endif