Apply clang-format across the whole tree

Run clang-format (the repo's .clang-format: LLVM base, 120 cols, tabs,
Allman functions) over every source file so the tree is formatter-clean.
Whitespace only -- no behavior change; full x64 + x86 suites pass.

Also set SortIncludes: false in .clang-format. Windows include order is
load-bearing (windows.h must precede tlhelp32.h / mmreg.h / xinput.h /
dinput.h; winsock2.h must precede windows.h), and the default
alphabetical sort reorders tlhelp32.h ahead of windows.h -- a build
break. Leaving order alone keeps the manual, correct grouping.
This commit is contained in:
2026-07-12 11:52:53 +02:00
parent c684a15fb9
commit 30eccf749d
155 changed files with 3333 additions and 6171 deletions

View File

@@ -15,8 +15,7 @@
#include <windows.h>
namespace coop::mock
{
namespace coop::mock {
// Encode a frame counter into an RGB triple (and back). R/G/B are the low 24 bits, so it
// is unambiguous for ~16M frames. The swap chain is UNORM (not sRGB), so the bytes survive
@@ -30,8 +29,7 @@ inline void frame_to_rgb(std::uint32_t frame, std::uint8_t& r, std::uint8_t& g,
inline std::uint32_t rgb_to_frame(std::uint8_t r, std::uint8_t g, std::uint8_t b)
{
return static_cast<std::uint32_t>(r) | (static_cast<std::uint32_t>(g) << 8) |
(static_cast<std::uint32_t>(b) << 16);
return static_cast<std::uint32_t>(r) | (static_cast<std::uint32_t>(g) << 8) | (static_cast<std::uint32_t>(b) << 16);
}
// Size (px) of the top-left frame-counter block the test samples.
@@ -44,8 +42,7 @@ inline constexpr std::uint32_t kBarWidth = 24;
// IDENTICAL image (the capture test compares backends). Each backend consumes these values with its
// own API's clear/fill calls: an animated full-screen background, a kBarWidth-wide full-height white
// bar at bar_x, and the top-left kFrameBlock-square frame-counter block whose colour encodes `frame`.
struct FramePattern
{
struct FramePattern {
std::uint8_t bg_r, bg_g, bg_b; // background; each channel sweeps at a different rate -> motion
std::uint32_t bar_x; // left edge of the moving bar
std::uint8_t code_r, code_g, code_b; // frame-counter block colour (frame_to_rgb)
@@ -63,9 +60,8 @@ inline FramePattern frame_pattern(std::uint32_t frame, std::uint32_t width)
return p;
}
class RenderBackend
{
public:
class RenderBackend {
public:
virtual ~RenderBackend() = default;
// Bring up the device + swap chain on `hwnd` at the given client size. False on failure.