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 // This file is here so other GLES2 related files can have a common set of | 5 // This file is here so other GLES2 related files can have a common set of |
6 // includes where appropriate. | 6 // includes where appropriate. |
7 | 7 |
8 #include <sstream> | 8 #include <sstream> |
9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: | 801 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: |
802 return 4; | 802 return 4; |
803 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: | 803 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: |
804 return 5; | 804 return 5; |
805 default: | 805 default: |
806 NOTREACHED(); | 806 NOTREACHED(); |
807 return 0; | 807 return 0; |
808 } | 808 } |
809 } | 809 } |
810 | 810 |
| 811 uint32_t GLES2Util::GLTextureTargetToBindingTarget(uint32_t textarget) { |
| 812 switch (textarget) { |
| 813 case GL_TEXTURE_2D: |
| 814 case GL_TEXTURE_EXTERNAL_OES: |
| 815 case GL_TEXTURE_RECTANGLE_ARB: |
| 816 case GL_TEXTURE_3D: |
| 817 case GL_TEXTURE_2D_ARRAY: |
| 818 return textarget; |
| 819 case GL_TEXTURE_CUBE_MAP_POSITIVE_X: |
| 820 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: |
| 821 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: |
| 822 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: |
| 823 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: |
| 824 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: |
| 825 return GL_TEXTURE_CUBE_MAP; |
| 826 default: |
| 827 NOTREACHED(); |
| 828 return GL_TEXTURE_2D; |
| 829 } |
| 830 } |
| 831 |
811 uint32 GLES2Util::GetPreferredGLReadPixelsFormat(uint32 internal_format) { | 832 uint32 GLES2Util::GetPreferredGLReadPixelsFormat(uint32 internal_format) { |
812 switch (internal_format) { | 833 switch (internal_format) { |
813 case GL_RGB16F_EXT: | 834 case GL_RGB16F_EXT: |
814 case GL_RGB32F_EXT: | 835 case GL_RGB32F_EXT: |
815 return GL_RGB; | 836 return GL_RGB; |
816 case GL_RGBA16F_EXT: | 837 case GL_RGBA16F_EXT: |
817 case GL_RGBA32F_EXT: | 838 case GL_RGBA32F_EXT: |
818 return GL_RGBA; | 839 return GL_RGBA; |
819 default: | 840 default: |
820 return GL_RGBA; | 841 return GL_RGBA; |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 } | 1261 } |
1241 | 1262 |
1242 return true; | 1263 return true; |
1243 } | 1264 } |
1244 | 1265 |
1245 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" | 1266 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" |
1246 | 1267 |
1247 } // namespace gles2 | 1268 } // namespace gles2 |
1248 } // namespace gpu | 1269 } // namespace gpu |
1249 | 1270 |
OLD | NEW |