| 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 10508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10519 // than 2^15-1 overflow in the negative range. | 10519 // than 2^15-1 overflow in the negative range. |
| 10520 case GL_TEXTURE_BASE_LEVEL: | 10520 case GL_TEXTURE_BASE_LEVEL: |
| 10521 if (workarounds().use_shadowed_tex_level_params) { | 10521 if (workarounds().use_shadowed_tex_level_params) { |
| 10522 if (fparams) { | 10522 if (fparams) { |
| 10523 fparams[0] = static_cast<GLfloat>(texture->base_level()); | 10523 fparams[0] = static_cast<GLfloat>(texture->base_level()); |
| 10524 } else { | 10524 } else { |
| 10525 iparams[0] = texture->base_level(); | 10525 iparams[0] = texture->base_level(); |
| 10526 } | 10526 } |
| 10527 return; | 10527 return; |
| 10528 } | 10528 } |
| 10529 break; |
| 10529 case GL_TEXTURE_MAX_LEVEL: | 10530 case GL_TEXTURE_MAX_LEVEL: |
| 10530 if (workarounds().use_shadowed_tex_level_params) { | 10531 if (workarounds().use_shadowed_tex_level_params) { |
| 10531 if (fparams) { | 10532 if (fparams) { |
| 10532 fparams[0] = static_cast<GLfloat>(texture->max_level()); | 10533 fparams[0] = static_cast<GLfloat>(texture->max_level()); |
| 10533 } else { | 10534 } else { |
| 10534 iparams[0] = texture->max_level(); | 10535 iparams[0] = texture->max_level(); |
| 10535 } | 10536 } |
| 10536 return; | 10537 return; |
| 10537 } | 10538 } |
| 10539 break; |
| 10540 case GL_TEXTURE_SWIZZLE_R: |
| 10541 if (fparams) { |
| 10542 fparams[0] = static_cast<GLfloat>(texture->swizzle_r()); |
| 10543 } else { |
| 10544 iparams[0] = texture->swizzle_r(); |
| 10545 } |
| 10546 return; |
| 10547 case GL_TEXTURE_SWIZZLE_G: |
| 10548 if (fparams) { |
| 10549 fparams[0] = static_cast<GLfloat>(texture->swizzle_g()); |
| 10550 } else { |
| 10551 iparams[0] = texture->swizzle_g(); |
| 10552 } |
| 10553 return; |
| 10554 case GL_TEXTURE_SWIZZLE_B: |
| 10555 if (fparams) { |
| 10556 fparams[0] = static_cast<GLfloat>(texture->swizzle_b()); |
| 10557 } else { |
| 10558 iparams[0] = texture->swizzle_b(); |
| 10559 } |
| 10560 return; |
| 10561 case GL_TEXTURE_SWIZZLE_A: |
| 10562 if (fparams) { |
| 10563 fparams[0] = static_cast<GLfloat>(texture->swizzle_a()); |
| 10564 } else { |
| 10565 iparams[0] = texture->swizzle_a(); |
| 10566 } |
| 10567 return; |
| 10538 default: | 10568 default: |
| 10539 break; | 10569 break; |
| 10540 } | 10570 } |
| 10541 if (fparams) { | 10571 if (fparams) { |
| 10542 glGetTexParameterfv(target, pname, fparams); | 10572 glGetTexParameterfv(target, pname, fparams); |
| 10543 } else { | 10573 } else { |
| 10544 glGetTexParameteriv(target, pname, iparams); | 10574 glGetTexParameteriv(target, pname, iparams); |
| 10545 } | 10575 } |
| 10546 } | 10576 } |
| 10547 | 10577 |
| (...skipping 8317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18865 } | 18895 } |
| 18866 | 18896 |
| 18867 // Include the auto-generated part of this file. We split this because it means | 18897 // Include the auto-generated part of this file. We split this because it means |
| 18868 // we can easily edit the non-auto generated parts right here in this file | 18898 // we can easily edit the non-auto generated parts right here in this file |
| 18869 // instead of having to edit some template or the code generator. | 18899 // instead of having to edit some template or the code generator. |
| 18870 #include "base/macros.h" | 18900 #include "base/macros.h" |
| 18871 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 18901 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 18872 | 18902 |
| 18873 } // namespace gles2 | 18903 } // namespace gles2 |
| 18874 } // namespace gpu | 18904 } // namespace gpu |
| OLD | NEW |