LibWeb: Add stubbed-out WebGL2RenderingContext

This commit is contained in:
Andrew Kaster 2024-12-05 20:56:18 -07:00 committed by Alexander Kalenik
commit af536e1192
Notes: github-actions[bot] 2024-12-06 14:36:41 +00:00
19 changed files with 851 additions and 17 deletions

View file

@ -19,7 +19,7 @@ class HTMLCanvasElement final : public HTMLElement {
GC_DECLARE_ALLOCATOR(HTMLCanvasElement);
public:
using RenderingContext = Variant<GC::Root<CanvasRenderingContext2D>, GC::Root<WebGL::WebGLRenderingContext>, Empty>;
using RenderingContext = Variant<GC::Root<CanvasRenderingContext2D>, GC::Root<WebGL::WebGLRenderingContext>, GC::Root<WebGL::WebGL2RenderingContext>, Empty>;
virtual ~HTMLCanvasElement() override;
@ -57,11 +57,12 @@ private:
virtual GC::Ptr<Layout::Node> create_layout_node(CSS::StyleProperties) override;
virtual void adjust_computed_style(CSS::StyleProperties&) override;
template<typename ContextType>
JS::ThrowCompletionOr<HasOrCreatedContext> create_webgl_context(JS::Value options);
void reset_context_to_default_state();
void notify_context_about_canvas_size_change();
Variant<GC::Ref<HTML::CanvasRenderingContext2D>, GC::Ref<WebGL::WebGLRenderingContext>, Empty> m_context;
Variant<GC::Ref<HTML::CanvasRenderingContext2D>, GC::Ref<WebGL::WebGLRenderingContext>, GC::Ref<WebGL::WebGL2RenderingContext>, Empty> m_context;
};
}