From 6369737676347f86dc32e4c109193e8f0df9938c Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 28 Jun 2024 12:44:45 -0400 Subject: [PATCH] LibWeb: Ensure SkiaSurface is fully defined before it is allocated LLVM 18 on macOS correctly errs when we try to allocate an incomplete SkiaSurface object. --- .../LibWeb/Painting/DisplayListPlayerSkia.cpp | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp index 797d7e5a5218..962a35b2b27d 100644 --- a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp @@ -38,6 +38,19 @@ namespace Web::Painting { +class DisplayListPlayerSkia::SkiaSurface { +public: + SkCanvas& canvas() const { return *surface->getCanvas(); } + + SkiaSurface(sk_sp surface) + : surface(move(surface)) + { + } + +private: + sk_sp surface; +}; + #ifdef AK_OS_MACOS class SkiaMetalBackendContext final : public SkiaBackendContext { AK_MAKE_NONCOPYABLE(SkiaMetalBackendContext); @@ -94,19 +107,6 @@ DisplayListPlayerSkia::DisplayListPlayerSkia(SkiaBackendContext& context, Core:: } #endif -class DisplayListPlayerSkia::SkiaSurface { -public: - SkCanvas& canvas() const { return *surface->getCanvas(); } - - SkiaSurface(sk_sp surface) - : surface(move(surface)) - { - } - -private: - sk_sp surface; -}; - DisplayListPlayerSkia::DisplayListPlayerSkia(Gfx::Bitmap& bitmap) { VERIFY(bitmap.format() == Gfx::BitmapFormat::BGRA8888);