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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h

Issue 2370703003: Validate internalformat/format/type for uploading DOM elements to texture (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
index df6ad14b3f1fc69bd9e17d4b9fb64718cabcf6db..1db999c429ec46ad6c3eb72ec68efc275f364f36 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
@@ -859,9 +859,19 @@ protected:
// null. Otherwise, return the texture bound to the target.
WebGLTexture* validateTexture2DBinding(const char* functionName, GLenum target);
+ enum TexFuncValidationSourceType {
+ SourceArrayBufferView,
+ SourceImageData,
+ SourceHTMLImageElement,
+ SourceHTMLCanvasElement,
+ SourceHTMLVideoElement,
+ SourceImageBitmap,
+ SourceUnpackBuffer,
+ };
+
// Helper function to check input internalformat/format/type for functions {copy}Tex{Sub}Image.
// Generates GL error and returns false if parameters are invalid.
- bool validateTexFuncFormatAndType(const char* functionName, TexImageFunctionType, GLenum internalformat, GLenum format, GLenum type, GLint level);
+ bool validateTexFuncFormatAndType(const char* functionName, TexImageFunctionType, TexFuncValidationSourceType, GLenum internalformat, GLenum format, GLenum type, GLint level);
// Helper function to check readbuffer validity for copyTex{Sub}Image.
// If yes, obtains the bound read framebuffer, returns true.
@@ -887,16 +897,6 @@ protected:
// Generates GL error and returns false if not.
bool validateValueFitNonNegInt32(const char* functionName, const char* paramName, long long value);
- enum TexFuncValidationSourceType {
- SourceArrayBufferView,
- SourceImageData,
- SourceHTMLImageElement,
- SourceHTMLCanvasElement,
- SourceHTMLVideoElement,
- SourceImageBitmap,
- SourceUnpackBuffer,
- };
-
// Helper function for tex{Sub}Image{2|3}D to check if the input format/type/level/target/width/height/depth/border/xoffset/yoffset/zoffset are valid.
// Otherwise, it would return quickly without doing other work.
bool validateTexFunc(const char* functionName, TexImageFunctionType, TexFuncValidationSourceType, GLenum target, GLint level, GLenum internalformat, GLsizei width,
@@ -908,7 +908,7 @@ protected:
// Helper function to check input parameters for functions {copy}Tex{Sub}Image.
// Generates GL error and returns false if parameters are invalid.
- bool validateTexFuncParameters(const char* functionName, TexImageFunctionType, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type);
+ bool validateTexFuncParameters(const char* functionName, TexImageFunctionType, TexFuncValidationSourceType, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type);
enum NullDisposition {
NullAllowed,

Powered by Google App Engine
This is Rietveld 408576698