/* * Copyright (c) 2023, MacDue * Copyright (c) 2025, Shannon Booth * Copyright (c) 2025, Jelle Raaijmakers * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace Web::HTML { class CanvasPattern final : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(CanvasPattern, Bindings::PlatformObject); GC_DECLARE_ALLOCATOR(CanvasPattern); public: static WebIDL::ExceptionOr> create(JS::Realm&, CanvasImageSource const& image, StringView repetition); ~CanvasPattern(); NonnullRefPtr to_gfx_paint_style() { return m_pattern; } private: CanvasPattern(JS::Realm&, Gfx::CanvasPatternPaintStyle&); virtual void initialize(JS::Realm&) override; NonnullRefPtr m_pattern; }; }