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

Side by Side Diff: Source/modules/webgl/WebGL2RenderingContextBase.h

Issue 1323613005: Better state tracking and validation for bindBufferBase and bindBufferRange (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed feedback 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
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 TexStorageType3D, 188 TexStorageType3D,
189 }; 189 };
190 bool validateTexStorage(const char*, GLenum, GLsizei, GLenum, GLsizei, GLsiz ei, GLsizei, TexStorageType); 190 bool validateTexStorage(const char*, GLenum, GLsizei, GLenum, GLsizei, GLsiz ei, GLsizei, TexStorageType);
191 bool validateTexSubImage3D(const char*, GLenum target, GLint level, GLint xo ffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, GLsizei width, GLsizei height, GLsizei depth); 191 bool validateTexSubImage3D(const char*, GLenum target, GLint level, GLint xo ffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, GLsizei width, GLsizei height, GLsizei depth);
192 192
193 ScriptValue getInt64Parameter(ScriptState*, GLenum); 193 ScriptValue getInt64Parameter(ScriptState*, GLenum);
194 194
195 void texSubImage3DImpl(GLenum, GLint, GLint, GLint, GLint, GLenum, GLenum, I mage*, WebGLImageConversion::ImageHtmlDomSource, bool, bool); 195 void texSubImage3DImpl(GLenum, GLint, GLint, GLint, GLint, GLenum, GLenum, I mage*, WebGLImageConversion::ImageHtmlDomSource, bool, bool);
196 void samplerParameter(WebGLSampler*, GLenum, GLfloat, GLint, bool); 196 void samplerParameter(WebGLSampler*, GLenum, GLfloat, GLint, bool);
197 197
198 bool isBufferBoundToTransformFeedback(WebGLBuffer*);
199 bool isBufferBoundToNonTransformFeedback(WebGLBuffer*);
200 bool validateBufferTargetCompatiblity(const char*, GLenum, WebGLBuffer*);
Ken Russell (switch to Gerrit) 2015/09/04 20:51:32 typo: Compatiblity -> Compatibility
201
202 bool validateBufferBaseTarget(const char* functionName, GLenum target);
203 bool validateAndUpdateBufferBindBaseTarget(const char* functionName, GLenum, GLuint, WebGLBuffer*);
204
198 /* WebGLRenderingContextBase overrides */ 205 /* WebGLRenderingContextBase overrides */
199 unsigned getMaxWebGLLocationLength() const override { return 1024; }; 206 unsigned getMaxWebGLLocationLength() const override { return 1024; };
200 bool validateCapability(const char* functionName, GLenum) override; 207 bool validateCapability(const char* functionName, GLenum) override;
201 bool validateBufferTarget(const char* functionName, GLenum target) override; 208 bool validateBufferTarget(const char* functionName, GLenum target) override;
202 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web GLBuffer*) override; 209 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web GLBuffer*) override;
203 WebGLTexture* validateTextureBinding(const char* functionName, GLenum target , bool useSixEnumsForCubeMap) override; 210 WebGLTexture* validateTextureBinding(const char* functionName, GLenum target , bool useSixEnumsForCubeMap) override;
204 bool validateFramebufferTarget(GLenum target) override; 211 bool validateFramebufferTarget(GLenum target) override;
205 bool validateReadPixelsFormatAndType(GLenum format, GLenum type) override; 212 bool validateReadPixelsFormatAndType(GLenum format, GLenum type) override;
206 DOMArrayBufferView::ViewType readPixelsExpectedArrayBufferViewType(GLenum ty pe) override; 213 DOMArrayBufferView::ViewType readPixelsExpectedArrayBufferViewType(GLenum ty pe) override;
207 WebGLFramebuffer* getFramebufferBinding(GLenum target) override; 214 WebGLFramebuffer* getFramebufferBinding(GLenum target) override;
(...skipping 11 matching lines...) Expand all
219 GLint m_max3DTextureSize; 226 GLint m_max3DTextureSize;
220 GLint m_max3DTextureLevel; 227 GLint m_max3DTextureLevel;
221 228
222 PersistentWillBeMember<WebGLBuffer> m_boundCopyReadBuffer; 229 PersistentWillBeMember<WebGLBuffer> m_boundCopyReadBuffer;
223 PersistentWillBeMember<WebGLBuffer> m_boundCopyWriteBuffer; 230 PersistentWillBeMember<WebGLBuffer> m_boundCopyWriteBuffer;
224 PersistentWillBeMember<WebGLBuffer> m_boundPixelPackBuffer; 231 PersistentWillBeMember<WebGLBuffer> m_boundPixelPackBuffer;
225 PersistentWillBeMember<WebGLBuffer> m_boundPixelUnpackBuffer; 232 PersistentWillBeMember<WebGLBuffer> m_boundPixelUnpackBuffer;
226 PersistentWillBeMember<WebGLBuffer> m_boundTransformFeedbackBuffer; 233 PersistentWillBeMember<WebGLBuffer> m_boundTransformFeedbackBuffer;
227 PersistentWillBeMember<WebGLBuffer> m_boundUniformBuffer; 234 PersistentWillBeMember<WebGLBuffer> m_boundUniformBuffer;
228 235
236 PersistentHeapVectorWillBeHeapVector<Member<WebGLBuffer>> m_boundIndexedTran sformFeedbackBuffers;
237 PersistentHeapVectorWillBeHeapVector<Member<WebGLBuffer>> m_boundIndexedUnif ormBuffers;
238
229 PersistentWillBeMember<WebGLQuery> m_currentBooleanOcclusionQuery; 239 PersistentWillBeMember<WebGLQuery> m_currentBooleanOcclusionQuery;
230 PersistentWillBeMember<WebGLQuery> m_currentTransformFeedbackPrimitivesWritt enQuery; 240 PersistentWillBeMember<WebGLQuery> m_currentTransformFeedbackPrimitivesWritt enQuery;
231 PersistentHeapVectorWillBeHeapVector<Member<WebGLSampler>> m_samplerUnits; 241 PersistentHeapVectorWillBeHeapVector<Member<WebGLSampler>> m_samplerUnits;
232 }; 242 };
233 243
234 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, 244 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context,
235 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, 245 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2,
236 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ; 246 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ;
237 247
238 } // namespace blink 248 } // namespace blink
239 249
240 #endif 250 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698