Chromium Code Reviews| 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. | |
|
Zhenyao Mo
2016/05/27 22:33:44
Could you put this code behind a workaround? say,
| |
| 9276 case GL_TEXTURE_BASE_LEVEL: | |
| 9277 if (fparams) { | |
| 9278 fparams[0] = static_cast<GLfloat>(texture->base_level()); | |
| 9279 } else { | |
| 9280 iparams[0] = texture->base_level(); | |
| 9281 } | |
| 9282 return; | |
| 9283 case GL_TEXTURE_MAX_LEVEL: | |
| 9284 if (fparams) { | |
| 9285 fparams[0] = static_cast<GLfloat>(texture->max_level()); | |
| 9286 } else { | |
| 9287 iparams[0] = texture->max_level(); | |
| 9288 } | |
| 9289 return; | |
| 9273 default: | 9290 default: |
| 9274 break; | 9291 break; |
| 9275 } | 9292 } |
| 9276 if (fparams) { | 9293 if (fparams) { |
| 9277 glGetTexParameterfv(target, pname, fparams); | 9294 glGetTexParameterfv(target, pname, fparams); |
| 9278 } else { | 9295 } else { |
| 9279 glGetTexParameteriv(target, pname, iparams); | 9296 glGetTexParameteriv(target, pname, iparams); |
| 9280 } | 9297 } |
| 9281 } | 9298 } |
| 9282 | 9299 |
| (...skipping 7542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 16825 } | 16842 } |
| 16826 | 16843 |
| 16827 // Include the auto-generated part of this file. We split this because it means | 16844 // 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 | 16845 // 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. | 16846 // instead of having to edit some template or the code generator. |
| 16830 #include "base/macros.h" | 16847 #include "base/macros.h" |
| 16831 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 16848 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 16832 | 16849 |
| 16833 } // namespace gles2 | 16850 } // namespace gles2 |
| 16834 } // namespace gpu | 16851 } // namespace gpu |
| OLD | NEW |