diff --git a/specs/latest/2.0/index.html b/specs/latest/2.0/index.html index 17087d6d8..3a0fdd90d 100644 --- a/specs/latest/2.0/index.html +++ b/specs/latest/2.0/index.html @@ -266,6 +266,15 @@

Types

 typedef long long GLint64;
 typedef unsigned long long GLuint64;
+
+dictionary WebGLCopyElementImageConfig {
+  GLfloat sx;
+  GLfloat sy;
+  GLfloat swidth;
+  GLfloat sheight;
+  GLsizei width;
+  GLsizei height;
+};
 
@@ -935,6 +944,9 @@

The WebGL context

optional unsigned long long srcOffset = 0, optional GLuint srcLengthOverride = 0); + undefined texElementImage2D(GLenum target, GLenum internalformat, (Element or ElementImage) element, + optional WebGLCopyElementImageConfig config = {}); // May throw DOMException + undefined uniform1fv(WebGLUniformLocation? location, Float32List data, optional unsigned long long srcOffset = 0, optional GLuint srcLength = 0); undefined uniform2fv(WebGLUniformLocation? location, Float32List data, optional unsigned long long srcOffset = 0, @@ -2210,6 +2222,31 @@

Texture objects

offset is the byte offset into the WebGLBuffer's data store; generates an INVALID_VALUE error if it's less than 0.

The ETC2 and EAC texture formats defined in OpenGL ES 3.0 are not available in WebGL 2.0. + +

+ [throws] undefined texElementImage2D(GLenum target, GLenum internalformat, (Element or ElementImage) element, + optional WebGLCopyElementImageConfig config = {}); +
+
+

Renders element to the currently bound WebGLTexture, redefining level 0 of the texture. This function always operates on level 0.

+

The element argument identifies an element image snapshot, as defined by HTML. The HTML algorithms define how element image snapshots are created, updated, retrieved, and filtered for security- or privacy-sensitive information. If element is an Element, the source rendering is the snapshot from the most recent paint event for the canvas of the current context. If element is an ElementImage, the source rendering is that captured snapshot.

+

If this function is called with an Element that is not a direct child of the canvas of the current context in the most recent rendering update, generates an INVALID_OPERATION error.

+

If target is not TEXTURE_2D, generates an INVALID_ENUM error.

+

If no WebGLTexture is bound to target, generates an INVALID_OPERATION error.

+

All pixel unpack state is ignored by this function, including the PIXEL_UNPACK_BUFFER binding and all UNPACK_ pixel store parameters.

+

If config.sx, config.sy, config.swidth, and config.sheight are all supplied, they define the source rectangle of the element image snapshot to render, in CSS pixels. If none of them are supplied, the source rectangle has sx and sy of 0, swidth equal to the source's natural width, and sheight equal to the source's natural height. If only some of them are supplied, generates an INVALID_VALUE error.

+

If config.width and config.height are both supplied, they define the generated texture size, in texels. If neither member is supplied, the texture width and height default to the source rectangle size scaled by the inverse of the canvas-grid-to-CSS scaling factor used to produce the element image snapshot. If only one of them is supplied, generates an INVALID_VALUE error.

+

The internalformat argument must be one of the values in the following table. Each value has an implied source format of RGBA and the listed implied source type:

+ + + + + + +
Internal FormatImplied Source Type
RGBA8UNSIGNED_BYTE
SRGB8_ALPHA8UNSIGNED_BYTE
RGBA16FHALF_FLOAT
RGBA32FFLOAT
+

If internalformat is not listed in the table above, generates an INVALID_ENUM error.

+

If any supplied numeric member of config is negative, or if the computed source rectangle width, source rectangle height, texture width, or texture height is not positive, generates an INVALID_VALUE error.

+
diff --git a/specs/latest/2.0/webgl2.idl b/specs/latest/2.0/webgl2.idl index c810cbf62..d6f00953e 100644 --- a/specs/latest/2.0/webgl2.idl +++ b/specs/latest/2.0/webgl2.idl @@ -27,6 +27,15 @@ typedef long long GLint64; typedef unsigned long long GLuint64; +dictionary WebGLCopyElementImageConfig { + GLfloat sx; + GLfloat sy; + GLfloat swidth; + GLfloat sheight; + GLsizei width; + GLsizei height; +}; + [Exposed=(Window,Worker)] interface WebGLQuery : WebGLObject { @@ -558,6 +567,9 @@ interface mixin WebGL2RenderingContextOverloads optional unsigned long long srcOffset = 0, optional GLuint srcLengthOverride = 0); + undefined texElementImage2D(GLenum target, GLenum internalformat, (Element or ElementImage) element, + optional WebGLCopyElementImageConfig config = {}); // May throw DOMException + undefined uniform1fv(WebGLUniformLocation? location, Float32List data, optional unsigned long long srcOffset = 0, optional GLuint srcLength = 0); undefined uniform2fv(WebGLUniformLocation? location, Float32List data, optional unsigned long long srcOffset = 0, @@ -601,4 +613,3 @@ interface WebGL2RenderingContext WebGL2RenderingContext includes WebGLRenderingContextBase; WebGL2RenderingContext includes WebGL2RenderingContextBase; WebGL2RenderingContext includes WebGL2RenderingContextOverloads; -