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

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

Issue 981913002: update getFramebufferAttachmentParameter for WebGL 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed zmo@'s feedback: wrong assertion and some small changes Created 5 years, 9 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 void uniformBlockBinding(WebGLProgram*, GLuint, GLuint); 154 void uniformBlockBinding(WebGLProgram*, GLuint, GLuint);
155 155
156 /* Vertex Array Objects */ 156 /* Vertex Array Objects */
157 PassRefPtrWillBeRawPtr<WebGLVertexArrayObjectOES> createVertexArray(); 157 PassRefPtrWillBeRawPtr<WebGLVertexArrayObjectOES> createVertexArray();
158 void deleteVertexArray(WebGLVertexArrayObjectOES*); 158 void deleteVertexArray(WebGLVertexArrayObjectOES*);
159 GLboolean isVertexArray(WebGLVertexArrayObjectOES*); 159 GLboolean isVertexArray(WebGLVertexArrayObjectOES*);
160 void bindVertexArray(WebGLVertexArrayObjectOES*); 160 void bindVertexArray(WebGLVertexArrayObjectOES*);
161 161
162 DECLARE_VIRTUAL_TRACE(); 162 DECLARE_VIRTUAL_TRACE();
163 163
164 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G Lenum attachment, GLenum pname) override;
165
164 protected: 166 protected:
165 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<blink::WebGraphics Context3D>, const WebGLContextAttributes& requestedAttributes); 167 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<blink::WebGraphics Context3D>, const WebGLContextAttributes& requestedAttributes);
166 168
167 bool validateClearBuffer(const char* functionName, GLenum buffer, GLsizei le ngth); 169 bool validateClearBuffer(const char* functionName, GLenum buffer, GLsizei le ngth);
168 170
171 // Helper function to validate target and the attachment combination for get FramebufferAttachmentParameters.
172 // Generate GL error and return false if parameters are illegal.
173 bool validateGetFramebufferAttachmentParameterFunc(const char* functionName, GLenum target, GLenum attachment);
174
169 /* WebGLRenderingContextBase overrides */ 175 /* WebGLRenderingContextBase overrides */
170 bool validateCapability(const char* functionName, GLenum) override; 176 bool validateCapability(const char* functionName, GLenum) override;
171 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web GLBuffer*) override; 177 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web GLBuffer*) override;
172 }; 178 };
173 179
174 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, 180 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context,
175 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, 181 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2,
176 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ; 182 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ;
177 183
178 } // namespace blink 184 } // namespace blink
179 185
180 #endif 186 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698