Remove duplicate formats and types validation

validateTexFuncFormatAndType is called twice from validateTexFuncData and
validateTexFunc. This isn't necessary.

BUG=295792

Review URL: https://codereview.chromium.org/1311413003

git-svn-id: svn://svn.chromium.org/blink/trunk@201525 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0ac0e4a0
...@@ -4115,8 +4115,8 @@ void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in ...@@ -4115,8 +4115,8 @@ void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in
GLsizei width, GLsizei height, GLint border, GLsizei width, GLsizei height, GLint border,
GLenum format, GLenum type, DOMArrayBufferView* pixels) GLenum format, GLenum type, DOMArrayBufferView* pixels)
{ {
if (isContextLost() || !validateTexFuncData("texImage2D", level, width, height, internalformat, format, type, pixels, NullAllowed) if (isContextLost() || !validateTexFunc("texImage2D", NotTexSubImage2D, SourceArrayBufferView, target, level, internalformat, width, height, border, format, type, 0, 0)
|| !validateTexFunc("texImage2D", NotTexSubImage2D, SourceArrayBufferView, target, level, internalformat, width, height, border, format, type, 0, 0)) || !validateTexFuncData("texImage2D", level, width, height, internalformat, format, type, pixels, NullAllowed))
return; return;
void* data = pixels ? pixels->baseAddress() : 0; void* data = pixels ? pixels->baseAddress() : 0;
Vector<uint8_t> tempData; Vector<uint8_t> tempData;
...@@ -4441,8 +4441,8 @@ void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint ...@@ -4441,8 +4441,8 @@ void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
return; return;
GLenum internalformat = texture->getInternalFormat(target, level); GLenum internalformat = texture->getInternalFormat(target, level);
if (isContextLost() || !validateTexFuncData("texSubImage2D", level, width, height, internalformat, format, type, pixels, NullNotAllowed) if (isContextLost() || !validateTexFunc("texSubImage2D", TexSubImage2D, SourceArrayBufferView, target, level, 0, width, height, 0, format, type, xoffset, yoffset)
|| !validateTexFunc("texSubImage2D", TexSubImage2D, SourceArrayBufferView, target, level, 0, width, height, 0, format, type, xoffset, yoffset)) || !validateTexFuncData("texSubImage2D", level, width, height, internalformat, format, type, pixels, NullNotAllowed))
return; return;
void* data = pixels->baseAddress(); void* data = pixels->baseAddress();
Vector<uint8_t> tempData; Vector<uint8_t> tempData;
...@@ -5524,8 +5524,6 @@ bool WebGLRenderingContextBase::validateTexFuncData(const char* functionName, GL ...@@ -5524,8 +5524,6 @@ bool WebGLRenderingContextBase::validateTexFuncData(const char* functionName, GL
return false; return false;
} }
if (!validateTexFuncFormatAndType(functionName, internalformat, format, type, level))
return false;
if (!validateSettableTexFormat(functionName, format)) if (!validateSettableTexFormat(functionName, format))
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment