/* * Copyright (c) 2024, Aliaksandr Kalenik * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::WebGL { class OpenGLContext { public: static OwnPtr create(NonnullRefPtr); void notify_content_will_change(); void clear_buffer_to_default_values(); void allocate_painting_surface_if_needed(); struct Impl; OpenGLContext(NonnullRefPtr, Impl); ~OpenGLContext(); void make_current(); void set_size(Gfx::IntSize const&); RefPtr surface(); u32 default_framebuffer() const; u32 default_renderbuffer() const; Vector get_supported_extensions(); void request_extension(char const* extension_name); private: NonnullRefPtr m_skia_backend_context; Gfx::IntSize m_size; RefPtr m_painting_surface; NonnullOwnPtr m_impl; Optional> m_requestable_extensions; }; }