/* * Copyright (c) 2024, Aliaksandr Kalenik * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #ifdef AK_OS_MACOS # include #endif #ifdef USE_VULKAN # include #endif class GrDirectContext; class SkSurface; namespace Gfx { class MetalContext; class SkiaBackendContext : public RefCounted { AK_MAKE_NONCOPYABLE(SkiaBackendContext); AK_MAKE_NONMOVABLE(SkiaBackendContext); public: #ifdef USE_VULKAN static RefPtr create_vulkan_context(Gfx::VulkanContext&); #endif #ifdef AK_OS_MACOS static RefPtr create_metal_context(MetalContext&); #endif SkiaBackendContext() { } virtual ~SkiaBackendContext() { } virtual void flush_and_submit(SkSurface*) { } virtual GrDirectContext* sk_context() const = 0; virtual MetalContext& metal_context() = 0; }; }