LibWeb/WebGL: Add initial implementation of texImage2D with image source

a
This commit is contained in:
Luke Wilde 2024-12-05 13:15:36 +00:00 committed by Alexander Kalenik
commit a65a981a6b
Notes: github-actions[bot] 2024-12-05 20:43:12 +00:00
2 changed files with 58 additions and 3 deletions

View file

@ -1,5 +1,14 @@
#import <WebGL/Types.idl>
typedef (ImageBitmap or
ImageData or
HTMLImageElement or
HTMLCanvasElement or
HTMLVideoElement
// FIXME: OffscreenCanvas or
// FIXME: VideoFrame
) TexImageSource;
// FIXME: BufferSource should be a Float32Array
typedef (BufferSource or sequence<GLfloat>) Float32List;
@ -16,7 +25,7 @@ interface mixin WebGLRenderingContextOverloads {
[FIXME] undefined readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
undefined texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
[FIXME] undefined texImage2D(GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, TexImageSource source); // May throw DOMException
undefined texImage2D(GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, TexImageSource source); // May throw DOMException
[FIXME] undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
[FIXME] undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, TexImageSource source); // May throw DOMException