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

Side by Side Diff: Source/modules/webgl/WebGL2RenderingContextBase.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: code refactoring to fix bugs in conformance test Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/modules/webgl/WebGL2RenderingContextBase.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WebGL2RenderingContextBase_h 5 #ifndef WebGL2RenderingContextBase_h
6 #define WebGL2RenderingContextBase_h 6 #define WebGL2RenderingContextBase_h
7 7
8 #include "modules/webgl/WebGLExtension.h" 8 #include "modules/webgl/WebGLExtension.h"
9 #include "modules/webgl/WebGLRenderingContextBase.h" 9 #include "modules/webgl/WebGLRenderingContextBase.h"
10 10
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 ScriptValue getActiveUniformBlockParameter(ScriptState*, WebGLProgram*, GLui nt, GLenum); 151 ScriptValue getActiveUniformBlockParameter(ScriptState*, WebGLProgram*, GLui nt, GLenum);
152 String getActiveUniformBlockName(WebGLProgram*, GLuint); 152 String getActiveUniformBlockName(WebGLProgram*, GLuint);
153 void uniformBlockBinding(WebGLProgram*, GLuint, GLuint); 153 void uniformBlockBinding(WebGLProgram*, GLuint, GLuint);
154 154
155 /* Vertex Array Objects */ 155 /* Vertex Array Objects */
156 WebGLVertexArrayObject* createVertexArray(); 156 WebGLVertexArrayObject* createVertexArray();
157 void deleteVertexArray(WebGLVertexArrayObject*); 157 void deleteVertexArray(WebGLVertexArrayObject*);
158 GLboolean isVertexArray(WebGLVertexArrayObject*); 158 GLboolean isVertexArray(WebGLVertexArrayObject*);
159 void bindVertexArray(WebGLVertexArrayObject*); 159 void bindVertexArray(WebGLVertexArrayObject*);
160 160
161 /* Reading */
162 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form at, GLenum type, long long offset);
163
161 /* WebGLRenderingContextBase overrides */ 164 /* WebGLRenderingContextBase overrides */
162 void initializeNewContext() override; 165 void initializeNewContext() override;
163 void bindFramebuffer(GLenum target, WebGLFramebuffer*) override; 166 void bindFramebuffer(GLenum target, WebGLFramebuffer*) override;
164 void deleteFramebuffer(WebGLFramebuffer*) override; 167 void deleteFramebuffer(WebGLFramebuffer*) override;
165 ScriptValue getParameter(ScriptState*, GLenum pname) override; 168 ScriptValue getParameter(ScriptState*, GLenum pname) override;
166 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr ide; 169 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr ide;
167 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G Lenum attachment, GLenum pname) override; 170 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G Lenum attachment, GLenum pname) override;
171 void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum form at, GLenum type, DOMArrayBufferView* pixels) override;
168 void restoreCurrentFramebuffer() override; 172 void restoreCurrentFramebuffer() override;
169 173
170 EAGERLY_FINALIZE(); 174 EAGERLY_FINALIZE();
171 DECLARE_VIRTUAL_TRACE(); 175 DECLARE_VIRTUAL_TRACE();
172 176
173 protected: 177 protected:
174 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext 3D>, const WebGLContextAttributes& requestedAttributes); 178 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext 3D>, const WebGLContextAttributes& requestedAttributes);
175 179
176 // Helper function to validate target and the attachment combination for get FramebufferAttachmentParameters. 180 // Helper function to validate target and the attachment combination for get FramebufferAttachmentParameters.
177 // Generate GL error and return false if parameters are illegal. 181 // Generate GL error and return false if parameters are illegal.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 PersistentHeapVectorWillBeHeapVector<Member<WebGLSampler>> m_samplerUnits; 230 PersistentHeapVectorWillBeHeapVector<Member<WebGLSampler>> m_samplerUnits;
227 }; 231 };
228 232
229 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, 233 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context,
230 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, 234 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2,
231 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ; 235 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ;
232 236
233 } // namespace blink 237 } // namespace blink
234 238
235 #endif 239 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/modules/webgl/WebGL2RenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698