mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Move some methods out of the WebGLRenderingContextBase mixin
Those methods are to be overloaded in WebGL2, but this can't be done with their current definitions, thanks to https://github.com/KhronosGroup/WebGL/issues/2216.
This commit is contained in:
parent
bb2b6a7a41
commit
93d2082acb
2 changed files with 75 additions and 39 deletions
|
@ -179,6 +179,7 @@ interface WebGL2RenderingContextBase
|
|||
const GLenum FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216;
|
||||
const GLenum FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217;
|
||||
const GLenum FRAMEBUFFER_DEFAULT = 0x8218;
|
||||
// BUG: https://github.com/KhronosGroup/WebGL/issues/2216
|
||||
// const GLenum DEPTH_STENCIL_ATTACHMENT = 0x821A;
|
||||
// const GLenum DEPTH_STENCIL = 0x84F9;
|
||||
const GLenum UNSIGNED_INT_24_8 = 0x84FA;
|
||||
|
@ -303,9 +304,13 @@ interface WebGL2RenderingContextBase
|
|||
|
||||
/* Buffer objects */
|
||||
// WebGL1:
|
||||
// void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
|
||||
// void bufferData(GLenum target, [AllowShared] BufferSource? srcData, GLenum usage);
|
||||
// void bufferSubData(GLenum target, GLintptr dstByteOffset, [AllowShared] BufferSource srcData);
|
||||
// BUG: https://github.com/KhronosGroup/WebGL/issues/2216
|
||||
// FIXME(xanewok): https://github.com/servo/servo/issues/20513
|
||||
[Throws]
|
||||
void bufferData(GLenum target, object? data, GLenum usage);
|
||||
[Throws]
|
||||
void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
|
||||
void bufferSubData(GLenum target, GLintptr dstByteOffset, /*[AllowShared]*/ BufferSource srcData);
|
||||
// WebGL2:
|
||||
// void bufferData(GLenum target, [AllowShared] ArrayBufferView srcData, GLenum usage, GLuint srcOffset,
|
||||
// optional GLuint length = 0);
|
||||
|
@ -342,17 +347,23 @@ interface WebGL2RenderingContextBase
|
|||
// GLsizei height, GLsizei depth);
|
||||
|
||||
// WebGL1 legacy entrypoints:
|
||||
// void texImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
// GLsizei width, GLsizei height, GLint border, GLenum format,
|
||||
// GLenum type, [AllowShared] ArrayBufferView? pixels);
|
||||
// void texImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
// GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||
// BUG: https://github.com/KhronosGroup/WebGL/issues/2216
|
||||
[Throws]
|
||||
void texImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLsizei height, GLint border, GLenum format,
|
||||
GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||
[Throws]
|
||||
void texImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||
|
||||
// void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
// GLsizei width, GLsizei height,
|
||||
// GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
|
||||
// void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
// GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||
// BUG: https://github.com/KhronosGroup/WebGL/issues/2216
|
||||
[Throws]
|
||||
void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||
[Throws]
|
||||
void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||
|
||||
// WebGL2 entrypoints:
|
||||
// void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
|
||||
|
@ -498,8 +509,9 @@ interface WebGL2RenderingContextBase
|
|||
|
||||
/* Reading back pixels */
|
||||
// WebGL1:
|
||||
// void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type,
|
||||
// [AllowShared] ArrayBufferView? dstData);
|
||||
// BUG: https://github.com/KhronosGroup/WebGL/issues/2216
|
||||
void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type,
|
||||
/*[AllowShared]*/ ArrayBufferView? dstData);
|
||||
// WebGL2:
|
||||
// void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type,
|
||||
// GLintptr offset);
|
||||
|
|
|
@ -491,12 +491,10 @@ interface WebGLRenderingContextBase
|
|||
void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
|
||||
GLenum srcAlpha, GLenum dstAlpha);
|
||||
|
||||
// FIXME(xanewok): https://github.com/servo/servo/issues/20513
|
||||
[Throws]
|
||||
void bufferData(GLenum target, object? data, GLenum usage);
|
||||
[Throws]
|
||||
void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
|
||||
void bufferSubData(GLenum target, GLintptr offset, /*[AllowShared]*/ BufferSource data);
|
||||
// BUG: https://github.com/KhronosGroup/WebGL/issues/2216
|
||||
// void bufferData(GLenum target, object? data, GLenum usage);
|
||||
// void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
|
||||
// void bufferSubData(GLenum target, GLintptr offset, /*[AllowShared]*/ BufferSource data);
|
||||
|
||||
[WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target);
|
||||
void clear(GLbitfield mask);
|
||||
|
@ -604,8 +602,9 @@ interface WebGLRenderingContextBase
|
|||
void pixelStorei(GLenum pname, GLint param);
|
||||
void polygonOffset(GLfloat factor, GLfloat units);
|
||||
|
||||
void readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||
// BUG: https://github.com/KhronosGroup/WebGL/issues/2216
|
||||
// void readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
|
||||
// GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||
|
||||
void renderbufferStorage(GLenum target, GLenum internalformat,
|
||||
GLsizei width, GLsizei height);
|
||||
|
@ -621,14 +620,12 @@ interface WebGLRenderingContextBase
|
|||
void stencilOp(GLenum fail, GLenum zfail, GLenum zpass);
|
||||
void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
|
||||
|
||||
// FIXME: https://github.com/servo/servo/issues/20516
|
||||
[Throws]
|
||||
void texImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLsizei height, GLint border, GLenum format,
|
||||
GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||
[Throws]
|
||||
void texImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||
// BUG: https://github.com/KhronosGroup/WebGL/issues/2216
|
||||
// void texImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
// GLsizei width, GLsizei height, GLint border, GLenum format,
|
||||
// GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||
// void texImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
// GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||
[Throws, Pref="dom.webgl.dom_to_texture.enabled"]
|
||||
void texImageDOM(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type, HTMLIFrameElement source); // May throw DOMException
|
||||
|
@ -636,14 +633,12 @@ interface WebGLRenderingContextBase
|
|||
void texParameterf(GLenum target, GLenum pname, GLfloat param);
|
||||
void texParameteri(GLenum target, GLenum pname, GLint param);
|
||||
|
||||
// FIXME: https://github.com/servo/servo/issues/20516
|
||||
[Throws]
|
||||
void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||
[Throws]
|
||||
void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||
// BUG: https://github.com/KhronosGroup/WebGL/issues/2216
|
||||
// void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
// GLsizei width, GLsizei height,
|
||||
// GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||
// void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
// GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||
|
||||
void uniform1f(WebGLUniformLocation? location, GLfloat x);
|
||||
void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
|
||||
|
@ -691,5 +686,34 @@ interface WebGLRenderingContextBase
|
|||
[Exposed=Window]
|
||||
interface WebGLRenderingContext
|
||||
{
|
||||
// BUG: https://github.com/KhronosGroup/WebGL/issues/2216
|
||||
|
||||
// FIXME(xanewok): https://github.com/servo/servo/issues/20513
|
||||
[Throws]
|
||||
void bufferData(GLenum target, object? data, GLenum usage);
|
||||
[Throws]
|
||||
void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
|
||||
void bufferSubData(GLenum target, GLintptr offset, /*[AllowShared]*/ BufferSource data);
|
||||
|
||||
// FIXME: https://github.com/servo/servo/issues/20516
|
||||
[Throws]
|
||||
void texImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLsizei height, GLint border, GLenum format,
|
||||
GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||
[Throws]
|
||||
void texImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||
|
||||
// FIXME: https://github.com/servo/servo/issues/20516
|
||||
[Throws]
|
||||
void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||
[Throws]
|
||||
void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||
|
||||
void readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||
};
|
||||
WebGLRenderingContext implements WebGLRenderingContextBase;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue