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

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

Issue 2025703002: Pack repeated code in tex(Sub)Image2D and texSubImage3D into helper func (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pass enum instead of const char*, use a wrapper for validate2D(3D)Binding Created 4 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 "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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 bool validateBufferTarget(const char* functionName, GLenum target) override; 256 bool validateBufferTarget(const char* functionName, GLenum target) override;
257 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web GLBuffer*) override; 257 bool validateAndUpdateBufferBindTarget(const char* functionName, GLenum, Web GLBuffer*) override;
258 bool validateFramebufferTarget(GLenum target) override; 258 bool validateFramebufferTarget(GLenum target) override;
259 259
260 bool validateReadPixelsFormatAndType(GLenum format, GLenum type, DOMArrayBuf ferView*) override; 260 bool validateReadPixelsFormatAndType(GLenum format, GLenum type, DOMArrayBuf ferView*) override;
261 WebGLFramebuffer* getFramebufferBinding(GLenum target) override; 261 WebGLFramebuffer* getFramebufferBinding(GLenum target) override;
262 WebGLFramebuffer* getReadFramebufferBinding() override; 262 WebGLFramebuffer* getReadFramebufferBinding() override;
263 GLint getMaxTextureLevelForTarget(GLenum target) override; 263 GLint getMaxTextureLevelForTarget(GLenum target) override;
264 void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internal format, GLsizei width, GLsizei height, const char* functionName) override; 264 void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internal format, GLsizei width, GLsizei height, const char* functionName) override;
265 265
266 WebGLTexture* validateTexImageBinding(const char*, TexImageFunctionName, GLe num) override;
266 // Helper function to check texture 3D target and texture bound to the targe t. 267 // Helper function to check texture 3D target and texture bound to the targe t.
267 // Generate GL errors and return 0 if target is invalid or texture bound is 268 // Generate GL errors and return 0 if target is invalid or texture bound is
268 // null. Otherwise, return the texture bound to the target. 269 // null. Otherwise, return the texture bound to the target.
269 WebGLTexture* validateTexture3DBinding(const char* functionName, GLenum targ et); 270 WebGLTexture* validateTexture3DBinding(const char* functionName, GLenum targ et);
270 271
271 WebGLBuffer* validateBufferDataTarget(const char* functionName, GLenum targe t) override; 272 WebGLBuffer* validateBufferDataTarget(const char* functionName, GLenum targe t) override;
272 bool validateBufferDataUsage(const char* functionName, GLenum usage) overrid e; 273 bool validateBufferDataUsage(const char* functionName, GLenum usage) overrid e;
273 274
274 void removeBoundBuffer(WebGLBuffer*) override; 275 void removeBoundBuffer(WebGLBuffer*) override;
275 276
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 ScopedPersistent<v8::Array> m_queryWrappers; 317 ScopedPersistent<v8::Array> m_queryWrappers;
317 }; 318 };
318 319
319 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context, 320 DEFINE_TYPE_CASTS(WebGL2RenderingContextBase, CanvasRenderingContext, context,
320 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2, 321 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) >= 2,
321 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ; 322 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) >= 2) ;
322 323
323 } // namespace blink 324 } // namespace blink
324 325
325 #endif 326 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698