Index: Source/modules/webgl/WebGL2RenderingContextBase.cpp |
diff --git a/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
index 8c61c89da95560926cbff64fb2e0759630ec2f9e..6fe323c14f60778d968173c99645e8c431253f17 100644 |
--- a/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
+++ b/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
@@ -244,6 +244,30 @@ void WebGL2RenderingContextBase::readBuffer(GLenum mode) |
webContext()->readBuffer(mode); |
} |
+void WebGL2RenderingContextBase::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, DOMArrayBufferView* pixels) |
+{ |
+ if (isContextLost()) |
+ return; |
+ if (m_boundPixelPackBuffer.get()) { |
+ synthesizeGLError(GL_INVALID_OPERATION, "readPixels", "PIXEL_PACK buffer should not bound"); |
+ return; |
+ } |
+ |
+ WebGLRenderingContextBase::readPixels(x, y, width, height, format, type, pixels); |
+} |
+ |
+void WebGL2RenderingContextBase::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, long long offset) |
+{ |
+ if (isContextLost()) |
+ return; |
+ if (!m_boundPixelPackBuffer.get()) { |
+ synthesizeGLError(GL_INVALID_OPERATION, "readPixels", "no PIXEL_PACK buffer bound"); |
+ return; |
+ } |
+ |
Zhenyao Mo
2015/08/18 21:48:39
There are some missing validations here. I think
yunchao
2015/08/19 09:33:39
Yeah, I have written the code to validate the buff
|
+ WebGLRenderingContextBase::readPixelsImpl(x, y, width, height, format, type, (void*)offset, 0); |
Zhenyao Mo
2015/08/18 21:48:39
use static_cast instead of (void*).
yunchao
2015/08/19 09:33:39
Thanks! I tried static_cast, but it failed to buil
|
+} |
+ |
void WebGL2RenderingContextBase::renderbufferStorageImpl( |
GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, |
const char* functionName) |