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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 switch (buffer) { | 839 switch (buffer) { |
840 case GL_COLOR: | 840 case GL_COLOR: |
841 return 4; | 841 return 4; |
842 case GL_DEPTH: | 842 case GL_DEPTH: |
843 return 1; | 843 return 1; |
844 default: | 844 default: |
845 return 0; | 845 return 0; |
846 } | 846 } |
847 } | 847 } |
848 | 848 |
| 849 // static |
| 850 void GLES2Util::MapUint64ToTwoUint32( |
| 851 uint64_t v64, uint32_t* v32_0, uint32_t* v32_1) { |
| 852 DCHECK(v32_0 && v32_1); |
| 853 *v32_0 = static_cast<uint32_t>(v64 & 0xFFFFFFFF); |
| 854 *v32_1 = static_cast<uint32_t>((v64 & 0xFFFFFFFF00000000) >> 32); |
| 855 } |
| 856 |
| 857 // static |
| 858 uint64_t GLES2Util::MapTwoUint32ToUint64(uint32_t v32_0, uint32_t v32_1) { |
| 859 uint64_t v64 = v32_1; |
| 860 return (v64 << 32) | v32_0; |
| 861 } |
| 862 |
849 namespace { | 863 namespace { |
850 | 864 |
851 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in | 865 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in |
852 // the 16-bit range are the same as used by EGL. Those outside the 16-bit range | 866 // the 16-bit range are the same as used by EGL. Those outside the 16-bit range |
853 // are unique to Chromium. Attributes are matched using a closest fit algorithm. | 867 // are unique to Chromium. Attributes are matched using a closest fit algorithm. |
854 | 868 |
855 // From <EGL/egl.h>. | 869 // From <EGL/egl.h>. |
856 const int32 kAlphaSize = 0x3021; // EGL_ALPHA_SIZE | 870 const int32 kAlphaSize = 0x3021; // EGL_ALPHA_SIZE |
857 const int32 kBlueSize = 0x3022; // EGL_BLUE_SIZE | 871 const int32 kBlueSize = 0x3022; // EGL_BLUE_SIZE |
858 const int32 kGreenSize = 0x3023; // EGL_GREEN_SIZE | 872 const int32 kGreenSize = 0x3023; // EGL_GREEN_SIZE |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 } | 1006 } |
993 | 1007 |
994 return true; | 1008 return true; |
995 } | 1009 } |
996 | 1010 |
997 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" | 1011 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" |
998 | 1012 |
999 } // namespace gles2 | 1013 } // namespace gles2 |
1000 } // namespace gpu | 1014 } // namespace gpu |
1001 | 1015 |
OLD | NEW |