| 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 | |
| 863 namespace { | 849 namespace { |
| 864 | 850 |
| 865 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in | 851 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in |
| 866 // the 16-bit range are the same as used by EGL. Those outside the 16-bit range | 852 // the 16-bit range are the same as used by EGL. Those outside the 16-bit range |
| 867 // are unique to Chromium. Attributes are matched using a closest fit algorithm. | 853 // are unique to Chromium. Attributes are matched using a closest fit algorithm. |
| 868 | 854 |
| 869 // From <EGL/egl.h>. | 855 // From <EGL/egl.h>. |
| 870 const int32 kAlphaSize = 0x3021; // EGL_ALPHA_SIZE | 856 const int32 kAlphaSize = 0x3021; // EGL_ALPHA_SIZE |
| 871 const int32 kBlueSize = 0x3022; // EGL_BLUE_SIZE | 857 const int32 kBlueSize = 0x3022; // EGL_BLUE_SIZE |
| 872 const int32 kGreenSize = 0x3023; // EGL_GREEN_SIZE | 858 const int32 kGreenSize = 0x3023; // EGL_GREEN_SIZE |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1006 } | 992 } |
| 1007 | 993 |
| 1008 return true; | 994 return true; |
| 1009 } | 995 } |
| 1010 | 996 |
| 1011 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" | 997 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" |
| 1012 | 998 |
| 1013 } // namespace gles2 | 999 } // namespace gles2 |
| 1014 } // namespace gpu | 1000 } // namespace gpu |
| 1015 | 1001 |
| OLD | NEW |