소스 검색

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.
Timothy Flynn 1 년 전
부모
커밋
6369737676
1개의 변경된 파일13개의 추가작업 그리고 13개의 파일을 삭제
  1. 13 13
      Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp

+ 13 - 13
Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp

@@ -38,6 +38,19 @@
 
 
 namespace Web::Painting {
 namespace Web::Painting {
 
 
+class DisplayListPlayerSkia::SkiaSurface {
+public:
+    SkCanvas& canvas() const { return *surface->getCanvas(); }
+
+    SkiaSurface(sk_sp<SkSurface> surface)
+        : surface(move(surface))
+    {
+    }
+
+private:
+    sk_sp<SkSurface> surface;
+};
+
 #ifdef AK_OS_MACOS
 #ifdef AK_OS_MACOS
 class SkiaMetalBackendContext final : public SkiaBackendContext {
 class SkiaMetalBackendContext final : public SkiaBackendContext {
     AK_MAKE_NONCOPYABLE(SkiaMetalBackendContext);
     AK_MAKE_NONCOPYABLE(SkiaMetalBackendContext);
@@ -94,19 +107,6 @@ DisplayListPlayerSkia::DisplayListPlayerSkia(SkiaBackendContext& context, Core::
 }
 }
 #endif
 #endif
 
 
-class DisplayListPlayerSkia::SkiaSurface {
-public:
-    SkCanvas& canvas() const { return *surface->getCanvas(); }
-
-    SkiaSurface(sk_sp<SkSurface> surface)
-        : surface(move(surface))
-    {
-    }
-
-private:
-    sk_sp<SkSurface> surface;
-};
-
 DisplayListPlayerSkia::DisplayListPlayerSkia(Gfx::Bitmap& bitmap)
 DisplayListPlayerSkia::DisplayListPlayerSkia(Gfx::Bitmap& bitmap)
 {
 {
     VERIFY(bitmap.format() == Gfx::BitmapFormat::BGRA8888);
     VERIFY(bitmap.format() == Gfx::BitmapFormat::BGRA8888);