Bug 1250710 - Re-add inherited webgl1-entrypoint. - r=jrmuizel draft
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 14 Jun 2016 10:05:55 -0700
changeset 379637 be0599af61e3c89fc79e6d874c6f0c54a610aacc
parent 379636 ffe8ab045881e9cbf03a29ff69ffcd63c8b87869
child 379638 81009b4935c02ceae6f5cb170ac2c11f284dd579
push id21016
push userbmo:jgilbert@mozilla.com
push dateThu, 16 Jun 2016 14:33:55 +0000
reviewersjrmuizel
bugs1250710
milestone50.0a1
Bug 1250710 - Re-add inherited webgl1-entrypoint. - r=jrmuizel Inherited overloads must be re-declared. MozReview-Commit-ID: A0lJd5cFVjA
dom/canvas/WebGL2Context.h
dom/webidl/WebGL2RenderingContext.webidl
--- a/dom/canvas/WebGL2Context.h
+++ b/dom/canvas/WebGL2Context.h
@@ -53,16 +53,23 @@ private:
 public:
     void GetBufferSubData(GLenum target, GLintptr offset,
                           const dom::Nullable<dom::ArrayBuffer>& maybeData);
     void GetBufferSubData(GLenum target, GLintptr offset,
                           const dom::SharedArrayBuffer& data);
     void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
                     GLenum type, GLintptr offset, ErrorResult& out_error);
 
+    void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
+                    GLenum format, GLenum type,
+                    const dom::Nullable<dom::ArrayBufferView>& pixels,
+                    ErrorResult& out_error)
+    {
+        WebGLContext::ReadPixels(x, y, width, height, format, type, pixels, out_error);
+    }
 
     // -------------------------------------------------------------------------
     // Framebuffer objects - WebGL2ContextFramebuffers.cpp
 
     void BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
                          GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
                          GLbitfield mask, GLenum filter);
     void FramebufferTextureLayer(GLenum target, GLenum attachment, WebGLTexture* texture, GLint level, GLint layer);
--- a/dom/webidl/WebGL2RenderingContext.webidl
+++ b/dom/webidl/WebGL2RenderingContext.webidl
@@ -316,19 +316,24 @@ interface WebGL2RenderingContext : WebGL
     const GLenum MAX_CLIENT_WAIT_TIMEOUT_WEBGL                 = 0x9247;
 
     /* Buffer objects */
     void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset,
                            GLintptr writeOffset, GLsizeiptr size);
     void getBufferSubData(GLenum target, GLintptr offset, ArrayBuffer? returnedData);
     void getBufferSubData(GLenum target, GLintptr offset, SharedArrayBuffer returnedData);
 
+
     [Throws] /* Throws on readback in a write-only context. */
     void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
                     GLenum type, GLintptr offset);
+    /* Include our WebGL 1 function override(s) */
+    [Throws]
+    void readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
+                    GLenum format, GLenum type, ArrayBufferView? pixels);
 
     /* Framebuffer objects */
     void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0,
                          GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
     void framebufferTextureLayer(GLenum target, GLenum attachment, WebGLTexture? texture, GLint level, GLint layer);
 
     [Throws]
     void invalidateFramebuffer(GLenum target, sequence<GLenum> attachments);