Bug 1250710 - Add stub. - r=jrmuizel draft
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 14 Jun 2016 09:01:43 -0700
changeset 383804 2dab18d32f137c532ac50f39daa211240d278921
parent 383803 fa265b28b889c2296beac9feeb53db8e35986bc6
child 383805 b69e1180f54da3e8f2e3b08c05d7518002329eb6
push id22101
push userbmo:jgilbert@mozilla.com
push dateTue, 05 Jul 2016 04:23:13 +0000
reviewersjrmuizel
bugs1250710
milestone50.0a1
Bug 1250710 - Add stub. - r=jrmuizel MozReview-Commit-ID: B555z5b3pyx
dom/canvas/WebGL2Context.h
dom/canvas/WebGL2ContextBuffers.cpp
--- a/dom/canvas/WebGL2Context.h
+++ b/dom/canvas/WebGL2Context.h
@@ -50,17 +50,26 @@ private:
     template<typename BufferT>
     void GetBufferSubDataT(GLenum target, GLintptr offset, const BufferT& data);
 
 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, WebGLsizeiptr 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/canvas/WebGL2ContextBuffers.cpp
+++ b/dom/canvas/WebGL2ContextBuffers.cpp
@@ -241,9 +241,20 @@ void WebGL2Context::GetBufferSubData(GLe
 }
 
 void WebGL2Context::GetBufferSubData(GLenum target, GLintptr offset,
                                      const dom::SharedArrayBuffer& data)
 {
     GetBufferSubDataT(target, offset, data);
 }
 
+void
+WebGL2Context::ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
+                          GLenum type, GLintptr offset)
+{
+    const char funcName[] = "readPixels";
+    if (IsContextLost())
+        return;
+
+    ErrorInvalidOperation("%s: Not yet implemented.", funcName);
+}
+
 } // namespace mozilla