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 03a2a4fdad2bf1a201aca6c4808f7735a2b640cb..b28c7768ec93803eda98abd56ad51febf2ac921c 100644 |
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| @@ -9270,6 +9270,27 @@ void GLES2DecoderImpl::GetTexParameterImpl( |
| return; |
| } |
| break; |
| + // Get the level information from the texture to avoid a Mac driver |
| + // bug where they store the levels in int16_t, making values bigger |
| + // than 2^15-1 overflow in the negative range. |
| + case GL_TEXTURE_BASE_LEVEL: |
| + if (workarounds().use_shadowed_tex_level_params) { |
| + if (fparams) { |
| + fparams[0] = static_cast<GLfloat>(texture->base_level()); |
| + } else { |
| + iparams[0] = texture->base_level(); |
| + } |
| + } |
| + return; |
|
Zhenyao Mo
2016/05/31 01:42:48
"return" inside the if statement, and "break" here
|
| + case GL_TEXTURE_MAX_LEVEL: |
| + if (workarounds().use_shadowed_tex_level_params) { |
| + if (fparams) { |
| + fparams[0] = static_cast<GLfloat>(texture->max_level()); |
| + } else { |
| + iparams[0] = texture->max_level(); |
| + } |
| + } |
| + return; |
|
Zhenyao Mo
2016/05/31 01:42:48
"return" inside the if statement, and "break" here
|
| default: |
| break; |
| } |