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 670782ecb6243bb97252cfe4918b8eb3cc585274..8003a7b5f661308278a78dd3d485ff817f208802 100644 |
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| @@ -5918,7 +5918,15 @@ bool GLES2DecoderImpl::GetHelper( |
| ScopedGLErrorSuppressor suppressor("GLES2DecoderImpl::GetHelper", |
| GetErrorState()); |
| glGetIntegerv(pname, params); |
| - if (glGetError() != GL_NO_ERROR) { |
| + bool is_valid_format = true; |
|
Zhenyao Mo
2016/07/19 16:42:38
You just need one is_valid, and you can initialize
|
| + bool is_valid_type = true; |
| + if (pname == GL_IMPLEMENTATION_COLOR_READ_FORMAT) { |
| + is_valid_format = validators_->read_pixel_format.IsValid(*params); |
| + } else { |
| + is_valid_type = validators_->read_pixel_type.IsValid(*params); |
| + } |
|
qiankun
2016/07/19 09:16:29
Maybe" ? : " is simpler than if-else. You just nee
|
| + if (glGetError() != GL_NO_ERROR || !is_valid_format || |
| + !is_valid_type) { |
|
yunchao
2016/07/19 09:39:32
What it returns if the format/type is invalid?
|
| if (pname == GL_IMPLEMENTATION_COLOR_READ_FORMAT) { |
| *params = GLES2Util::GetGLReadPixelsImplementationFormat( |
| GetBoundReadFrameBufferInternalFormat(), |