diff --git a/Libraries/LibGfx/SkiaBackendContext.cpp b/Libraries/LibGfx/SkiaBackendContext.cpp index 40528797744..e2d2ff7312d 100644 --- a/Libraries/LibGfx/SkiaBackendContext.cpp +++ b/Libraries/LibGfx/SkiaBackendContext.cpp @@ -90,7 +90,7 @@ class SkiaMetalBackendContext final : public SkiaBackendContext { AK_MAKE_NONMOVABLE(SkiaMetalBackendContext); public: - SkiaMetalBackendContext(sk_sp context, MetalContext& metal_context) + SkiaMetalBackendContext(sk_sp context, NonnullRefPtr metal_context) : m_context(move(context)) , m_metal_context(move(metal_context)) { @@ -114,13 +114,13 @@ private: NonnullRefPtr m_metal_context; }; -RefPtr SkiaBackendContext::create_metal_context(MetalContext& metal_context) +RefPtr SkiaBackendContext::create_metal_context(NonnullRefPtr metal_context) { GrMtlBackendContext backend_context; - backend_context.fDevice.retain(metal_context.device()); - backend_context.fQueue.retain(metal_context.queue()); + backend_context.fDevice.retain(metal_context->device()); + backend_context.fQueue.retain(metal_context->queue()); sk_sp ctx = GrDirectContexts::MakeMetal(backend_context); - return adopt_ref(*new SkiaMetalBackendContext(ctx, metal_context)); + return adopt_ref(*new SkiaMetalBackendContext(move(ctx), move(metal_context))); } #endif diff --git a/Libraries/LibGfx/SkiaBackendContext.h b/Libraries/LibGfx/SkiaBackendContext.h index af8c8760372..dd059b169dd 100644 --- a/Libraries/LibGfx/SkiaBackendContext.h +++ b/Libraries/LibGfx/SkiaBackendContext.h @@ -35,7 +35,7 @@ public: #endif #ifdef AK_OS_MACOS - static RefPtr create_metal_context(MetalContext&); + static RefPtr create_metal_context(NonnullRefPtr); #endif SkiaBackendContext() { }