OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |