Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1136)

Unified Diff: Source/modules/webgl/WebGLRenderingContextBase.h

Issue 1300573002: WebGL 2: add readPixels API to read pixels into pixel pack buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/webgl/WebGLRenderingContextBase.h
diff --git a/Source/modules/webgl/WebGLRenderingContextBase.h b/Source/modules/webgl/WebGLRenderingContextBase.h
index fb2d4636476f6c9d2c02aead671317d4d38229e3..f3c605055790cd29db2a430b5c57631416a1d46c 100644
--- a/Source/modules/webgl/WebGLRenderingContextBase.h
+++ b/Source/modules/webgl/WebGLRenderingContextBase.h
@@ -250,6 +250,7 @@ public:
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, DOMArrayBufferView* pixels);
+ void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, long long offset);
void renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
void sampleCoverage(GLfloat value, GLboolean invert);
void scissor(GLint x, GLint y, GLsizei width, GLsizei height);
@@ -489,6 +490,8 @@ protected:
// List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER and stored values for ELEMENT_ARRAY_BUFFER
PersistentWillBeMember<WebGLBuffer> m_boundArrayBuffer;
+ PersistentWillBeMember<WebGLBuffer> m_boundPixelPackBuffer;
+
PersistentWillBeMember<WebGLVertexArrayObjectBase> m_defaultVertexArrayObject;
PersistentWillBeMember<WebGLVertexArrayObjectBase> m_boundVertexArrayObject;
void setBoundVertexArrayObject(WebGLVertexArrayObjectBase* arrayObject)
@@ -821,6 +824,10 @@ protected:
// Generates INVALID_OPERATION and returns false if the combination is unsupported.
bool validateReadPixelsFormatTypeCombination(GLenum format, GLenum type, GLenum readBufferInternalFormat, GLenum readBufferType);
+ // Helper function to check parameters of readPixels. Returns true if all parameters
+ // are valid. Otherwise, generates appropriate error and returns false.
+ bool validateReadPixelsFuncParameters(GLsizei width, GLsizei height, GLenum format, GLenum type, unsigned domArrayBufferLength, WebGLFramebuffer*& readFramebufferBinding);
+
virtual GLint getMaxTextureLevelForTarget(GLenum target);
// Helper function to check input level for functions {copy}Tex{Sub}Image.

Powered by Google App Engine
This is Rietveld 408576698