From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- src/video_core/gpu_debugger.h | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) (limited to 'src/video_core/gpu_debugger.h') diff --git a/src/video_core/gpu_debugger.h b/src/video_core/gpu_debugger.h index a3aab216c..e3ba80d8f 100644 --- a/src/video_core/gpu_debugger.h +++ b/src/video_core/gpu_debugger.h @@ -10,17 +10,15 @@ #include "core/hle/service/gsp_gpu.h" -class GraphicsDebugger -{ +class GraphicsDebugger { public: // Base class for all objects which need to be notified about GPU events - class DebuggerObserver - { + class DebuggerObserver { public: - DebuggerObserver() : observed(nullptr) { } + DebuggerObserver() : observed(nullptr) { + } - virtual ~DebuggerObserver() - { + virtual ~DebuggerObserver() { if (observed) observed->UnregisterObserver(this); } @@ -31,15 +29,13 @@ public: * @param total_command_count Total number of commands in the GX history * @note All methods in this class are called from the GSP thread */ - virtual void GXCommandProcessed(int total_command_count) - { - const GSP_GPU::Command& cmd = observed->ReadGXCommandHistory(total_command_count-1); + virtual void GXCommandProcessed(int total_command_count) { + const GSP_GPU::Command& cmd = observed->ReadGXCommandHistory(total_command_count - 1); LOG_TRACE(Debug_GPU, "Received command: id=%x", (int)cmd.id.Value()); } protected: - const GraphicsDebugger* GetDebugger() const - { + const GraphicsDebugger* GetDebugger() const { return observed; } @@ -49,8 +45,7 @@ public: friend class GraphicsDebugger; }; - void GXCommandProcessed(u8* command_data) - { + void GXCommandProcessed(u8* command_data) { if (observers.empty()) return; @@ -60,33 +55,29 @@ public: memcpy(&cmd, command_data, sizeof(GSP_GPU::Command)); ForEachObserver([this](DebuggerObserver* observer) { - observer->GXCommandProcessed(static_cast(this->gx_command_history.size())); - } ); + observer->GXCommandProcessed(static_cast(this->gx_command_history.size())); + }); } - const GSP_GPU::Command& ReadGXCommandHistory(int index) const - { + const GSP_GPU::Command& ReadGXCommandHistory(int index) const { // TODO: Is this thread-safe? return gx_command_history[index]; } - void RegisterObserver(DebuggerObserver* observer) - { + void RegisterObserver(DebuggerObserver* observer) { // TODO: Check for duplicates observers.push_back(observer); observer->observed = this; } - void UnregisterObserver(DebuggerObserver* observer) - { + void UnregisterObserver(DebuggerObserver* observer) { observers.erase(std::remove(observers.begin(), observers.end(), observer), observers.end()); observer->observed = nullptr; } private: - void ForEachObserver(std::function func) - { - std::for_each(observers.begin(),observers.end(), func); + void ForEachObserver(std::function func) { + std::for_each(observers.begin(), observers.end(), func); } std::vector observers; -- cgit v1.2.3