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 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 return false; | 815 return false; |
816 } | 816 } |
817 getting_array_location = true; | 817 getting_array_location = true; |
818 } | 818 } |
819 *getting_array = getting_array_location; | 819 *getting_array = getting_array_location; |
820 *element_index = index.ValueOrDie(); | 820 *element_index = index.ValueOrDie(); |
821 *array_pos = open_pos; | 821 *array_pos = open_pos; |
822 return true; | 822 return true; |
823 } | 823 } |
824 | 824 |
| 825 size_t GLES2Util::CalcClearBufferivDataCount(int buffer) { |
| 826 switch (buffer) { |
| 827 case GL_COLOR: |
| 828 return 4; |
| 829 case GL_STENCIL: |
| 830 return 1; |
| 831 default: |
| 832 return 0; |
| 833 } |
| 834 } |
| 835 |
| 836 size_t GLES2Util::CalcClearBufferfvDataCount(int buffer) { |
| 837 switch (buffer) { |
| 838 case GL_COLOR: |
| 839 return 4; |
| 840 case GL_DEPTH: |
| 841 return 1; |
| 842 default: |
| 843 return 0; |
| 844 } |
| 845 } |
| 846 |
825 namespace { | 847 namespace { |
826 | 848 |
827 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in | 849 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in |
828 // the 16-bit range are the same as used by EGL. Those outside the 16-bit range | 850 // the 16-bit range are the same as used by EGL. Those outside the 16-bit range |
829 // are unique to Chromium. Attributes are matched using a closest fit algorithm. | 851 // are unique to Chromium. Attributes are matched using a closest fit algorithm. |
830 | 852 |
831 // From <EGL/egl.h>. | 853 // From <EGL/egl.h>. |
832 const int32 kAlphaSize = 0x3021; // EGL_ALPHA_SIZE | 854 const int32 kAlphaSize = 0x3021; // EGL_ALPHA_SIZE |
833 const int32 kBlueSize = 0x3022; // EGL_BLUE_SIZE | 855 const int32 kBlueSize = 0x3022; // EGL_BLUE_SIZE |
834 const int32 kGreenSize = 0x3023; // EGL_GREEN_SIZE | 856 const int32 kGreenSize = 0x3023; // EGL_GREEN_SIZE |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 } | 990 } |
969 | 991 |
970 return true; | 992 return true; |
971 } | 993 } |
972 | 994 |
973 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" | 995 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" |
974 | 996 |
975 } // namespace gles2 | 997 } // namespace gles2 |
976 } // namespace gpu | 998 } // namespace gpu |
977 | 999 |
OLD | NEW |