| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 9252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9263 if (feature_info_->gl_version_info().IsLowerThanGL(4, 2)) { | 9263 if (feature_info_->gl_version_info().IsLowerThanGL(4, 2)) { |
| 9264 GLint levels = texture->GetImmutableLevels(); | 9264 GLint levels = texture->GetImmutableLevels(); |
| 9265 if (fparams) { | 9265 if (fparams) { |
| 9266 fparams[0] = static_cast<GLfloat>(levels); | 9266 fparams[0] = static_cast<GLfloat>(levels); |
| 9267 } else { | 9267 } else { |
| 9268 iparams[0] = levels; | 9268 iparams[0] = levels; |
| 9269 } | 9269 } |
| 9270 return; | 9270 return; |
| 9271 } | 9271 } |
| 9272 break; | 9272 break; |
| 9273 // Get the level information from the texture to avoid a Mac driver |
| 9274 // bug where they store the levels in int16_t, making values bigger |
| 9275 // than 2^15-1 overflow in the negative range. |
| 9276 case GL_TEXTURE_BASE_LEVEL: |
| 9277 if (workarounds().use_shadowed_tex_level_params) { |
| 9278 if (fparams) { |
| 9279 fparams[0] = static_cast<GLfloat>(texture->base_level()); |
| 9280 } else { |
| 9281 iparams[0] = texture->base_level(); |
| 9282 } |
| 9283 return; |
| 9284 } |
| 9285 case GL_TEXTURE_MAX_LEVEL: |
| 9286 if (workarounds().use_shadowed_tex_level_params) { |
| 9287 if (fparams) { |
| 9288 fparams[0] = static_cast<GLfloat>(texture->max_level()); |
| 9289 } else { |
| 9290 iparams[0] = texture->max_level(); |
| 9291 } |
| 9292 return; |
| 9293 } |
| 9273 default: | 9294 default: |
| 9274 break; | 9295 break; |
| 9275 } | 9296 } |
| 9276 if (fparams) { | 9297 if (fparams) { |
| 9277 glGetTexParameterfv(target, pname, fparams); | 9298 glGetTexParameterfv(target, pname, fparams); |
| 9278 } else { | 9299 } else { |
| 9279 glGetTexParameteriv(target, pname, iparams); | 9300 glGetTexParameteriv(target, pname, iparams); |
| 9280 } | 9301 } |
| 9281 } | 9302 } |
| 9282 | 9303 |
| (...skipping 7542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16825 } | 16846 } |
| 16826 | 16847 |
| 16827 // Include the auto-generated part of this file. We split this because it means | 16848 // Include the auto-generated part of this file. We split this because it means |
| 16828 // we can easily edit the non-auto generated parts right here in this file | 16849 // we can easily edit the non-auto generated parts right here in this file |
| 16829 // instead of having to edit some template or the code generator. | 16850 // instead of having to edit some template or the code generator. |
| 16830 #include "base/macros.h" | 16851 #include "base/macros.h" |
| 16831 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 16852 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 16832 | 16853 |
| 16833 } // namespace gles2 | 16854 } // namespace gles2 |
| 16834 } // namespace gpu | 16855 } // namespace gpu |
| OLD | NEW |