Commit c5c1f865 authored by xidachen's avatar xidachen Committed by Commit bot

Handled neutered ImageData in texImage2D and texSubImage2D

Ideal we would like to throw an exception in this case. But since the
API for these two methods does not have RaiseException, this CL handles
this case the same way as the case when ImageData is null.

BUG=564846

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

Cr-Commit-Position: refs/heads/master@{#363069}
parent a05756be
......@@ -4339,6 +4339,10 @@ void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in
synthesizeGLError(GL_INVALID_VALUE, "texImage2D", "no image data");
return;
}
if (pixels->data()->bufferBase()->isNeutered()) {
synthesizeGLError(GL_INVALID_VALUE, "texImage2D", "The source data has been neutered.");
return;
}
if (isContextLost() || !validateTexFunc("texImage2D", NotTexSubImage2D, SourceImageData, target, level, internalformat, pixels->width(), pixels->height(), 0, format, type, 0, 0))
return;
if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) {
......@@ -4660,6 +4664,10 @@ void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
synthesizeGLError(GL_INVALID_VALUE, "texSubImage2D", "no image data");
return;
}
if (pixels->data()->bufferBase()->isNeutered()) {
synthesizeGLError(GL_INVALID_VALUE, "texSubImage2D", "The source data has been neutered.");
return;
}
if (isContextLost() || !validateTexFunc("texSubImage2D", TexSubImage2D, SourceImageData, target, level, 0, pixels->width(), pixels->height(), 0, format, type, xoffset, yoffset))
return;
if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) {
......
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