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

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: code rebase Created 5 years, 8 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 void bindVertexArray(WebGLVertexArrayObjectOES*); 160 void bindVertexArray(WebGLVertexArrayObjectOES*);
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 ScriptValue getParameter(ScriptState*, GLenum pname) override; 165 ScriptValue getParameter(ScriptState*, GLenum pname) override;
166 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr ide; 166 ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) overr ide;
167 167
168 DECLARE_VIRTUAL_TRACE(); 168 DECLARE_VIRTUAL_TRACE();
169 169
170 ScriptValue getFramebufferAttachmentParameter(ScriptState*, GLenum target, G Lenum attachment, GLenum pname) override;
171
170 protected: 172 protected:
171 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<blink::WebGraphics Context3D>, const WebGLContextAttributes& requestedAttributes); 173 WebGL2RenderingContextBase(HTMLCanvasElement*, PassOwnPtr<blink::WebGraphics Context3D>, const WebGLContextAttributes& requestedAttributes);
172 174
175 // Helper function to validate target and the attachment combination for get FramebufferAttachmentParameters.
176 // Generate GL error and return false if parameters are illegal.
177 bool validateGetFramebufferAttachmentParameterFunc(const char* functionName, GLenum target, GLenum attachment);
178
173 bool validateClearBuffer(const char* functionName, GLenum buffer, GLsizei le ngth); 179 bool validateClearBuffer(const char* functionName, GLenum buffer, GLsizei le ngth);
174 180
175 ScriptValue getInt64Parameter(ScriptState*, GLenum); 181 ScriptValue getInt64Parameter(ScriptState*, GLenum);
176 182
177 /* WebGLRenderingContextBase overrides */ 183 /* WebGLRenderingContextBase overrides */
178 bool validateCapability(const char* functionName, GLenum) override; 184 bool validateCapability(const char* functionName, GLenum) override;
179 bool validateBufferTarget(const char* functionName, GLenum target) override; 185 bool validateBufferTarget(const char* functionName, GLenum target) override;
180 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web GLBuffer*) override; 186 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web GLBuffer*) override;
181 WebGLTexture* validateTextureBinding(const char* functionName, GLenum target , bool useSixEnumsForCubeMap) override; 187 WebGLTexture* validateTextureBinding(const char* functionName, GLenum target , bool useSixEnumsForCubeMap) override;
182 188
183 RefPtrWillBeMember<WebGLFramebuffer> m_readFramebufferBinding; 189 RefPtrWillBeMember<WebGLFramebuffer> m_readFramebufferBinding;
184 }; 190 };
185 191
186 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, 192 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context,
187 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, 193 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2,
188 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ; 194 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ;
189 195
190 } // namespace blink 196 } // namespace blink
191 197
192 #endif 198 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698