LibWeb: Add OffscreenCanvas to IDL types

Add OffscreenCanvas to TexImageSource and CanvasImageSource.
Implement all the necessary features to make it work in all cases where
these types are used.
This commit is contained in:
Totto16 2025-03-06 23:41:31 +01:00 committed by Andrew Kaster
commit f1a096d6e4
Notes: github-actions[bot] 2025-06-30 15:47:37 +00:00
8 changed files with 35 additions and 9 deletions

View file

@ -6,8 +6,14 @@
#pragma once
#include <LibWeb/Forward.h>
#include <LibWeb/WebIDL/Types.h>
namespace Web::WebGL {
// NOTE: This is the Variant created by the IDL wrapper generator, and needs to be updated accordingly.
using TexImageSource = Variant<GC::Root<HTML::ImageBitmap>, GC::Root<HTML::ImageData>, GC::Root<HTML::HTMLImageElement>, GC::Root<HTML::HTMLCanvasElement>, GC::Root<HTML::OffscreenCanvas>, GC::Root<HTML::HTMLVideoElement>>;
// FIXME: This object should inherit from Bindings::PlatformObject and implement the WebGLRenderingContextBase IDL interface.
// We should make WebGL code generator to produce implementation for this interface.
class WebGLRenderingContextBase {

View file

@ -4,8 +4,8 @@ typedef (ImageBitmap or
ImageData or
HTMLImageElement or
HTMLCanvasElement or
HTMLVideoElement
// FIXME: OffscreenCanvas or
HTMLVideoElement or
OffscreenCanvas
// FIXME: VideoFrame
) TexImageSource;