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 "gpu/command_buffer/common/gles2_cmd_utils.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
9 | 9 |
10 #include <GLES2/gl2.h> | 10 #include <GLES2/gl2.h> |
(...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1836 | 1836 |
1837 // Chromium only. | 1837 // Chromium only. |
1838 const int32_t kBindGeneratesResource = 0x10000; | 1838 const int32_t kBindGeneratesResource = 0x10000; |
1839 const int32_t kFailIfMajorPerfCaveat = 0x10001; | 1839 const int32_t kFailIfMajorPerfCaveat = 0x10001; |
1840 const int32_t kLoseContextWhenOutOfMemory = 0x10002; | 1840 const int32_t kLoseContextWhenOutOfMemory = 0x10002; |
1841 const int32_t kShouldUseNativeGMBForBackbuffer = 0x10003; | 1841 const int32_t kShouldUseNativeGMBForBackbuffer = 0x10003; |
1842 const int32_t kContextType = 0x10004; | 1842 const int32_t kContextType = 0x10004; |
1843 | 1843 |
1844 } // namespace | 1844 } // namespace |
1845 | 1845 |
| 1846 bool IsWebGLContextType(ContextType context_type) { |
| 1847 // Switch statement to cause a compile-time error if we miss a case. |
| 1848 switch (context_type) { |
| 1849 case CONTEXT_TYPE_WEBGL1: |
| 1850 case CONTEXT_TYPE_WEBGL2: |
| 1851 return true; |
| 1852 case CONTEXT_TYPE_OPENGLES2: |
| 1853 case CONTEXT_TYPE_OPENGLES3: |
| 1854 return false; |
| 1855 } |
| 1856 |
| 1857 NOTREACHED(); |
| 1858 return false; |
| 1859 } |
| 1860 |
1846 ContextCreationAttribHelper::ContextCreationAttribHelper() | 1861 ContextCreationAttribHelper::ContextCreationAttribHelper() |
1847 : gpu_preference(gl::PreferIntegratedGpu), | 1862 : gpu_preference(gl::PreferIntegratedGpu), |
1848 alpha_size(-1), | 1863 alpha_size(-1), |
1849 blue_size(-1), | 1864 blue_size(-1), |
1850 green_size(-1), | 1865 green_size(-1), |
1851 red_size(-1), | 1866 red_size(-1), |
1852 depth_size(-1), | 1867 depth_size(-1), |
1853 stencil_size(-1), | 1868 stencil_size(-1), |
1854 samples(-1), | 1869 samples(-1), |
1855 sample_buffers(-1), | 1870 sample_buffers(-1), |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1930 } | 1945 } |
1931 | 1946 |
1932 return true; | 1947 return true; |
1933 } | 1948 } |
1934 | 1949 |
1935 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" | 1950 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" |
1936 | 1951 |
1937 } // namespace gles2 | 1952 } // namespace gles2 |
1938 } // namespace gpu | 1953 } // namespace gpu |
1939 | 1954 |
OLD | NEW |