| 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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 GL_TEXTURE_CUBE_MAP_POSITIVE_X, | 587 GL_TEXTURE_CUBE_MAP_POSITIVE_X, |
| 588 GL_TEXTURE_CUBE_MAP_NEGATIVE_X, | 588 GL_TEXTURE_CUBE_MAP_NEGATIVE_X, |
| 589 GL_TEXTURE_CUBE_MAP_POSITIVE_Y, | 589 GL_TEXTURE_CUBE_MAP_POSITIVE_Y, |
| 590 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, | 590 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, |
| 591 GL_TEXTURE_CUBE_MAP_POSITIVE_Z, | 591 GL_TEXTURE_CUBE_MAP_POSITIVE_Z, |
| 592 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, | 592 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, |
| 593 }; | 593 }; |
| 594 return faces[index]; | 594 return faces[index]; |
| 595 } | 595 } |
| 596 | 596 |
| 597 size_t GLES2Util::GLTargetToFaceIndex(uint32 target) { |
| 598 switch (target) { |
| 599 case GL_TEXTURE_2D: |
| 600 case GL_TEXTURE_EXTERNAL_OES: |
| 601 case GL_TEXTURE_RECTANGLE_ARB: |
| 602 return 0; |
| 603 case GL_TEXTURE_CUBE_MAP_POSITIVE_X: |
| 604 return 0; |
| 605 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: |
| 606 return 1; |
| 607 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: |
| 608 return 2; |
| 609 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: |
| 610 return 3; |
| 611 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: |
| 612 return 4; |
| 613 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: |
| 614 return 5; |
| 615 default: |
| 616 NOTREACHED(); |
| 617 return 0; |
| 618 } |
| 619 } |
| 620 |
| 597 uint32 GLES2Util::GetPreferredGLReadPixelsFormat(uint32 internal_format) { | 621 uint32 GLES2Util::GetPreferredGLReadPixelsFormat(uint32 internal_format) { |
| 598 switch (internal_format) { | 622 switch (internal_format) { |
| 599 case GL_RGB16F_EXT: | 623 case GL_RGB16F_EXT: |
| 600 case GL_RGB32F_EXT: | 624 case GL_RGB32F_EXT: |
| 601 return GL_RGB; | 625 return GL_RGB; |
| 602 case GL_RGBA16F_EXT: | 626 case GL_RGBA16F_EXT: |
| 603 case GL_RGBA32F_EXT: | 627 case GL_RGBA32F_EXT: |
| 604 return GL_RGBA; | 628 return GL_RGBA; |
| 605 default: | 629 default: |
| 606 return GL_RGBA; | 630 return GL_RGBA; |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 } | 931 } |
| 908 | 932 |
| 909 return true; | 933 return true; |
| 910 } | 934 } |
| 911 | 935 |
| 912 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" | 936 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" |
| 913 | 937 |
| 914 } // namespace gles2 | 938 } // namespace gles2 |
| 915 } // namespace gpu | 939 } // namespace gpu |
| 916 | 940 |
| OLD | NEW |