Chromium Code Reviews| Index: gpu/command_buffer/service/gles2_cmd_srgb_converter.cc |
| diff --git a/gpu/command_buffer/service/gles2_cmd_srgb_converter.cc b/gpu/command_buffer/service/gles2_cmd_srgb_converter.cc |
| index 5556e9d20739c510b6c51434eff68252f51d2ac1..37e141faaa2a09cd57f59c71c50a503ea854fc88 100644 |
| --- a/gpu/command_buffer/service/gles2_cmd_srgb_converter.cc |
| +++ b/gpu/command_buffer/service/gles2_cmd_srgb_converter.cc |
| @@ -424,8 +424,9 @@ void SRGBConverter::GenerateMipmap(const gles2::GLES2Decoder* decoder, |
| TextureManager::ComputeMipMapCount(target, width, height, depth); |
| } |
| const GLint max_mipmap_available_levels = |
| - (base_level + mipmap_levels) > max_level ? max_level |
| - : (base_level + mipmap_levels); |
| + (base_level + mipmap_levels - 1) > max_level |
|
yunchao
2017/05/05 08:01:48
Please check that max_level, not max_level - 1?
yizhou.jiang
2017/05/08 08:28:56
The variable name is quite confusing, so I change
|
| + ? max_level |
| + : (base_level + mipmap_levels - 1); |
| glBindTexture(GL_TEXTURE_2D, srgb_converter_textures_[1]); |
| if (feature_info_->ext_color_buffer_float_available() && |
| @@ -473,7 +474,7 @@ void SRGBConverter::GenerateMipmap(const gles2::GLES2Decoder* decoder, |
| // TODO(yizhou): An optimization. Attach 1 level at a time, once for every |
| // iteration of the loop. |
| - for (GLint level = base_level + 1; level < max_mipmap_available_levels; |
| + for (GLint level = base_level + 1; level <= max_mipmap_available_levels; |
|
yunchao
2017/05/05 08:01:48
I think it is <=, instead of <.
yizhou.jiang
2017/05/08 08:28:56
Done.
|
| ++level) { |
| // copy mipmaps level by level from srgb_converter_textures_[1] to tex |
| // generate mipmap for tex manually |