Chromium Code Reviews| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc |
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| index bc87b967863c8ab49f0b9fae775a623c33ce7d41..09c2b91f938633957163adcc4cbe31eee47ee95a 100644 |
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| @@ -8138,7 +8138,7 @@ void GLES2DecoderImpl::DoCompressedTexSubImage2D( |
| return; |
| } |
| if (!texture->ValidForTexture( |
| - target, level, xoffset, yoffset, width, height, format, type)) { |
| + target, level, xoffset, yoffset, width, height, type)) { |
|
oetuaho-nv
2014/02/13 14:03:58
Comparing with the texture's format here was redun
|
| LOCAL_SET_GL_ERROR( |
| GL_INVALID_VALUE, "glCompressedTexSubImage2D", "bad dimensions."); |
| return; |
| @@ -8207,9 +8207,9 @@ void GLES2DecoderImpl::DoCopyTexImage2D( |
| GL_INVALID_VALUE, "glCopyTexImage2D", "dimensions out of range"); |
| return; |
| } |
| - if (!texture_manager()->ValidateTextureParameters( |
| - state_.GetErrorState(), "glCopyTexImage2D", target, internal_format, |
| - GL_UNSIGNED_BYTE, level)) { |
| + if (!texture_manager()->ValidateFormatAndTypeCombination( |
| + state_.GetErrorState(), "glCopyTexImage2D", internal_format, |
| + GL_UNSIGNED_BYTE)) { |
|
oetuaho-nv
2014/02/13 14:03:58
Here the check for the depth/stencil format was ev
|
| return; |
| } |
| @@ -8322,7 +8322,7 @@ void GLES2DecoderImpl::DoCopyTexSubImage2D( |
| GLenum format = 0; |
| if (!texture->GetLevelType(target, level, &type, &format) || |
| !texture->ValidForTexture( |
| - target, level, xoffset, yoffset, width, height, format, type)) { |
| + target, level, xoffset, yoffset, width, height, type)) { |
| LOCAL_SET_GL_ERROR( |
| GL_INVALID_VALUE, "glCopyTexSubImage2D", "bad dimensions."); |
| return; |
| @@ -8428,14 +8428,6 @@ bool GLES2DecoderImpl::ValidateTexSubImage2D( |
| LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "height < 0"); |
| return false; |
| } |
| - if (!validators_->texture_format.IsValid(format)) { |
| - LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, format, "format"); |
| - return false; |
| - } |
| - if (!validators_->pixel_type.IsValid(type)) { |
| - LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, type, "type"); |
| - return false; |
| - } |
| TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( |
| &state_, target); |
| if (!texture_ref) { |
| @@ -8452,10 +8444,8 @@ bool GLES2DecoderImpl::ValidateTexSubImage2D( |
| GL_INVALID_OPERATION, function_name, "level does not exist."); |
| return false; |
| } |
| - if (format != internal_format) { |
| - LOCAL_SET_GL_ERROR( |
| - GL_INVALID_OPERATION, |
| - function_name, "format does not match internal format."); |
| + if (!texture_manager()->ValidateTextureParameters(state_.GetErrorState(), |
| + function_name, format, type, internal_format, level)) { |
| return false; |
| } |
| if (type != current_type) { |
| @@ -8471,7 +8461,7 @@ bool GLES2DecoderImpl::ValidateTexSubImage2D( |
| return false; |
| } |
| if (!texture->ValidForTexture( |
| - target, level, xoffset, yoffset, width, height, format, type)) { |
| + target, level, xoffset, yoffset, width, height, type)) { |
| LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "bad dimensions."); |
| return false; |
| } |