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

@ -27,7 +27,7 @@ namespace Web::WebGL {
GC_DEFINE_ALLOCATOR(WebGLRenderingContext);
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#fire-a-webgl-context-event
static void fire_webgl_context_event(HTML::HTMLCanvasElement& canvas_element, FlyString const& type)
void fire_webgl_context_event(HTML::HTMLCanvasElement& canvas_element, FlyString const& type)
{
// To fire a WebGL context event named e means that an event using the WebGLContextEvent interface, with its type attribute [DOM4] initialized to e, its cancelable attribute initialized to true, and its isTrusted attribute [DOM4] initialized to true, is to be dispatched at the given object.
// FIXME: Consider setting a status message.
@ -38,7 +38,7 @@ static void fire_webgl_context_event(HTML::HTMLCanvasElement& canvas_element, Fl
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#fire-a-webgl-context-creation-error
static void fire_webgl_context_creation_error(HTML::HTMLCanvasElement& canvas_element)
void fire_webgl_context_creation_error(HTML::HTMLCanvasElement& canvas_element)
{
// 1. Fire a WebGL context event named "webglcontextcreationerror" at canvas, optionally with its statusMessage attribute set to a platform dependent string about the nature of the failure.
fire_webgl_context_event(canvas_element, EventNames::webglcontextcreationerror);