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 #include "gpu/command_buffer/service/feature_info.h" | 5 #include "gpu/command_buffer/service/feature_info.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); | 174 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); |
175 | 175 |
176 // The shader translator is needed to translate from WebGL-conformant GLES SL | 176 // The shader translator is needed to translate from WebGL-conformant GLES SL |
177 // to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to | 177 // to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to |
178 // target context GLSL, implement emulation of OpenGL ES features on OpenGL, | 178 // target context GLSL, implement emulation of OpenGL ES features on OpenGL, |
179 // etc. | 179 // etc. |
180 // The flag here is for testing only. | 180 // The flag here is for testing only. |
181 disable_shader_translator_ = | 181 disable_shader_translator_ = |
182 command_line->HasSwitch(switches::kDisableGLSLTranslator); | 182 command_line->HasSwitch(switches::kDisableGLSLTranslator); |
183 | 183 |
184 enable_cmaa_shaders_switch_ = | |
185 command_line->HasSwitch(switches::kEnableCMAAShaders); | |
186 | |
187 unsafe_es3_apis_enabled_ = false; | 184 unsafe_es3_apis_enabled_ = false; |
188 | 185 |
189 // Default context_type_ to a GLES2 Context. | 186 // Default context_type_ to a GLES2 Context. |
190 context_type_ = CONTEXT_TYPE_OPENGLES2; | 187 context_type_ = CONTEXT_TYPE_OPENGLES2; |
191 | 188 |
192 chromium_color_buffer_float_rgba_available_ = false; | 189 chromium_color_buffer_float_rgba_available_ = false; |
193 chromium_color_buffer_float_rgb_available_ = false; | 190 chromium_color_buffer_float_rgb_available_ = false; |
194 ext_color_buffer_float_available_ = false; | 191 ext_color_buffer_float_available_ = false; |
195 oes_texture_float_linear_available_ = false; | 192 oes_texture_float_linear_available_ = false; |
196 oes_texture_half_float_linear_available_ = false; | 193 oes_texture_half_float_linear_available_ = false; |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 extensions.Contains("GL_EXT_multisample_compatibility")) { | 882 extensions.Contains("GL_EXT_multisample_compatibility")) { |
886 AddExtensionString("GL_EXT_multisample_compatibility"); | 883 AddExtensionString("GL_EXT_multisample_compatibility"); |
887 feature_flags_.ext_multisample_compatibility = true; | 884 feature_flags_.ext_multisample_compatibility = true; |
888 validators_.capability.AddValue(GL_MULTISAMPLE_EXT); | 885 validators_.capability.AddValue(GL_MULTISAMPLE_EXT); |
889 validators_.capability.AddValue(GL_SAMPLE_ALPHA_TO_ONE_EXT); | 886 validators_.capability.AddValue(GL_SAMPLE_ALPHA_TO_ONE_EXT); |
890 } | 887 } |
891 | 888 |
892 if (extensions.Contains("GL_INTEL_framebuffer_CMAA")) { | 889 if (extensions.Contains("GL_INTEL_framebuffer_CMAA")) { |
893 feature_flags_.chromium_screen_space_antialiasing = true; | 890 feature_flags_.chromium_screen_space_antialiasing = true; |
894 AddExtensionString("GL_CHROMIUM_screen_space_antialiasing"); | 891 AddExtensionString("GL_CHROMIUM_screen_space_antialiasing"); |
895 } else if (enable_cmaa_shaders_switch_ && | 892 } else if (!workarounds_.disable_framebuffer_cmaa && |
896 (gl_version_info_->IsAtLeastGLES(3, 1) || | 893 (gl_version_info_->IsAtLeastGLES(3, 1) || |
897 (gl_version_info_->IsAtLeastGL(3, 0) && | 894 (gl_version_info_->IsAtLeastGL(3, 0) && |
898 extensions.Contains("GL_ARB_shading_language_420pack") && | 895 extensions.Contains("GL_ARB_shading_language_420pack") && |
899 extensions.Contains("GL_ARB_texture_gather") && | 896 extensions.Contains("GL_ARB_texture_gather") && |
900 extensions.Contains("GL_ARB_explicit_uniform_location") && | 897 extensions.Contains("GL_ARB_explicit_uniform_location") && |
901 extensions.Contains("GL_ARB_explicit_attrib_location") && | 898 extensions.Contains("GL_ARB_explicit_attrib_location") && |
902 extensions.Contains("GL_ARB_shader_image_load_store")))) { | 899 extensions.Contains("GL_ARB_shader_image_load_store")))) { |
903 feature_flags_.chromium_screen_space_antialiasing = true; | 900 feature_flags_.chromium_screen_space_antialiasing = true; |
904 feature_flags_.use_chromium_screen_space_antialiasing_via_shaders = true; | 901 feature_flags_.use_chromium_screen_space_antialiasing_via_shaders = true; |
905 AddExtensionString("GL_CHROMIUM_screen_space_antialiasing"); | 902 AddExtensionString("GL_CHROMIUM_screen_space_antialiasing"); |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1415 if (pos == std::string::npos) { | 1412 if (pos == std::string::npos) { |
1416 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1413 extensions_ += (extensions_.empty() ? "" : " ") + str; |
1417 } | 1414 } |
1418 } | 1415 } |
1419 | 1416 |
1420 FeatureInfo::~FeatureInfo() { | 1417 FeatureInfo::~FeatureInfo() { |
1421 } | 1418 } |
1422 | 1419 |
1423 } // namespace gles2 | 1420 } // namespace gles2 |
1424 } // namespace gpu | 1421 } // namespace gpu |
OLD | NEW |