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

Side by Side Diff: Source/core/html/canvas/WebGL2RenderingContextBase.h

Issue 1120953002: WebGL 2: add read/write framebuffer binding points to related APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed zmo@'s and kbr@'s feedback Created 5 years, 6 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
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 "core/html/canvas/WebGLExtension.h" 8 #include "core/html/canvas/WebGLExtension.h"
9 #include "core/html/canvas/WebGLRenderingContextBase.h" 9 #include "core/html/canvas/WebGLRenderingContextBase.h"
10 #include "wtf/PassRefPtr.h" 10 #include "wtf/PassRefPtr.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 /* Vertex Array Objects */ 156 /* Vertex Array Objects */
157 PassRefPtrWillBeRawPtr<WebGLVertexArrayObject> createVertexArray(); 157 PassRefPtrWillBeRawPtr<WebGLVertexArrayObject> createVertexArray();
158 void deleteVertexArray(WebGLVertexArrayObject*); 158 void deleteVertexArray(WebGLVertexArrayObject*);
159 GLboolean isVertexArray(WebGLVertexArrayObject*); 159 GLboolean isVertexArray(WebGLVertexArrayObject*);
160 void bindVertexArray(WebGLVertexArrayObject*); 160 void bindVertexArray(WebGLVertexArrayObject*);
161 161
162 /* WebGLRenderingContextBase overrides */ 162 /* WebGLRenderingContextBase overrides */
163 void initializeNewContext() override; 163 void initializeNewContext() override;
164 void bindFramebuffer(GLenum target, WebGLFramebuffer*) override; 164 void bindFramebuffer(GLenum target, WebGLFramebuffer*) override;
165 void deleteFramebuffer(WebGLFramebuffer*) override;
165 ScriptValue getParameter(ScriptState*, GLenum pname) override; 166 ScriptValue getParameter(ScriptState*, GLenum pname) override;
166 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr ide; 167 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr ide;
167 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G Lenum attachment, GLenum pname) override; 168 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G Lenum attachment, GLenum pname) override;
169 void restoreCurrentFramebuffer() override;
168 170
169 EAGERLY_FINALIZE(); 171 EAGERLY_FINALIZE();
170 DECLARE_VIRTUAL_TRACE(); 172 DECLARE_VIRTUAL_TRACE();
171 173
172 protected: 174 protected:
173 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext 3D>, const WebGLContextAttributes& requestedAttributes); 175 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext 3D>, const WebGLContextAttributes& requestedAttributes);
174 176
175 // Helper function to validate target and the attachment combination for get FramebufferAttachmentParameters. 177 // Helper function to validate target and the attachment combination for get FramebufferAttachmentParameters.
176 // Generate GL error and return false if parameters are illegal. 178 // Generate GL error and return false if parameters are illegal.
177 bool validateGetFramebufferAttachmentParameterFunc(const char* functionName, GLenum target, GLenum attachment); 179 bool validateGetFramebufferAttachmentParameterFunc(const char* functionName, GLenum target, GLenum attachment);
(...skipping 13 matching lines...) Expand all
191 193
192 /* WebGLRenderingContextBase overrides */ 194 /* WebGLRenderingContextBase overrides */
193 bool validateCapability(const char* functionName, GLenum) override; 195 bool validateCapability(const char* functionName, GLenum) override;
194 bool validateBufferTarget(const char* functionName, GLenum target) override; 196 bool validateBufferTarget(const char* functionName, GLenum target) override;
195 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web GLBuffer*) override; 197 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web GLBuffer*) override;
196 WebGLTexture* validateTextureBinding(const char* functionName, GLenum target , bool useSixEnumsForCubeMap) override; 198 WebGLTexture* validateTextureBinding(const char* functionName, GLenum target , bool useSixEnumsForCubeMap) override;
197 bool validateFramebufferTarget(GLenum target) override; 199 bool validateFramebufferTarget(GLenum target) override;
198 WebGLFramebuffer* getFramebufferBinding(GLenum target) override; 200 WebGLFramebuffer* getFramebufferBinding(GLenum target) override;
199 GLint getMaxTextureLevelForTarget(GLenum target) override; 201 GLint getMaxTextureLevelForTarget(GLenum target) override;
200 void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internal format, GLsizei width, GLsizei height, const char* functionName) override; 202 void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internal format, GLsizei width, GLsizei height, const char* functionName) override;
203 GLenum boundFramebufferColorFormat() override;
201 204
202 WebGLBuffer* validateBufferDataTarget(const char* functionName, GLenum targe t) override; 205 WebGLBuffer* validateBufferDataTarget(const char* functionName, GLenum targe t) override;
203 206
204 void removeBoundBuffer(WebGLBuffer*) override; 207 void removeBoundBuffer(WebGLBuffer*) override;
205 208
206 RefPtrWillBeMember<WebGLFramebuffer> m_readFramebufferBinding; 209 RefPtrWillBeMember<WebGLFramebuffer> m_readFramebufferBinding;
207 RefPtrWillBeMember<WebGLTransformFeedback> m_transformFeedbackBinding; 210 RefPtrWillBeMember<WebGLTransformFeedback> m_transformFeedbackBinding;
208 GLint m_max3DTextureSize; 211 GLint m_max3DTextureSize;
209 GLint m_max3DTextureLevel; 212 GLint m_max3DTextureLevel;
210 213
211 RefPtrWillBeMember<WebGLBuffer> m_boundCopyReadBuffer; 214 RefPtrWillBeMember<WebGLBuffer> m_boundCopyReadBuffer;
212 RefPtrWillBeMember<WebGLBuffer> m_boundCopyWriteBuffer; 215 RefPtrWillBeMember<WebGLBuffer> m_boundCopyWriteBuffer;
213 RefPtrWillBeMember<WebGLBuffer> m_boundPixelPackBuffer; 216 RefPtrWillBeMember<WebGLBuffer> m_boundPixelPackBuffer;
214 RefPtrWillBeMember<WebGLBuffer> m_boundPixelUnpackBuffer; 217 RefPtrWillBeMember<WebGLBuffer> m_boundPixelUnpackBuffer;
215 RefPtrWillBeMember<WebGLBuffer> m_boundTransformFeedbackBuffer; 218 RefPtrWillBeMember<WebGLBuffer> m_boundTransformFeedbackBuffer;
216 RefPtrWillBeMember<WebGLBuffer> m_boundUniformBuffer; 219 RefPtrWillBeMember<WebGLBuffer> m_boundUniformBuffer;
217 }; 220 };
218 221
219 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, 222 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context,
220 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, 223 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2,
221 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ; 224 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ;
222 225
223 } // namespace blink 226 } // namespace blink
224 227
225 #endif 228 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698