mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-29 04:39:10 +00:00
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.
This commit is contained in:
parent
d9470d6a93
commit
6369737676
Notes:
sideshowbarker
2024-07-17 04:57:23 +09:00
Author: https://github.com/trflynn89
Commit: 6369737676
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/307
1 changed files with 13 additions and 13 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue