| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 216 |
| 217 feature_flags_.is_swiftshader = | 217 feature_flags_.is_swiftshader = |
| 218 (command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); | 218 (command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); |
| 219 | 219 |
| 220 feature_flags_.enable_subscribe_uniform = | 220 feature_flags_.enable_subscribe_uniform = |
| 221 command_line->HasSwitch(switches::kEnableSubscribeUniformExtension); | 221 command_line->HasSwitch(switches::kEnableSubscribeUniformExtension); |
| 222 | 222 |
| 223 enable_unsafe_es3_apis_switch_ = | 223 enable_unsafe_es3_apis_switch_ = |
| 224 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); | 224 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); |
| 225 | 225 |
| 226 enable_gl_path_rendering_switch_ = | |
| 227 command_line->HasSwitch(switches::kEnableGLPathRendering); | |
| 228 | |
| 229 // The shader translator is needed to translate from WebGL-conformant GLES SL | 226 // The shader translator is needed to translate from WebGL-conformant GLES SL |
| 230 // to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to | 227 // to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to |
| 231 // target context GLSL, implement emulation of OpenGL ES features on OpenGL, | 228 // target context GLSL, implement emulation of OpenGL ES features on OpenGL, |
| 232 // etc. | 229 // etc. |
| 233 // The flag here is for testing only. | 230 // The flag here is for testing only. |
| 234 disable_shader_translator_ = | 231 disable_shader_translator_ = |
| 235 command_line->HasSwitch(switches::kDisableGLSLTranslator); | 232 command_line->HasSwitch(switches::kDisableGLSLTranslator); |
| 236 | 233 |
| 237 unsafe_es3_apis_enabled_ = false; | 234 unsafe_es3_apis_enabled_ = false; |
| 238 | 235 |
| (...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 if (blend_equation_advanced_coherent) | 1235 if (blend_equation_advanced_coherent) |
| 1239 AddExtensionString("GL_KHR_blend_equation_advanced_coherent"); | 1236 AddExtensionString("GL_KHR_blend_equation_advanced_coherent"); |
| 1240 | 1237 |
| 1241 AddExtensionString("GL_KHR_blend_equation_advanced"); | 1238 AddExtensionString("GL_KHR_blend_equation_advanced"); |
| 1242 feature_flags_.blend_equation_advanced = true; | 1239 feature_flags_.blend_equation_advanced = true; |
| 1243 feature_flags_.blend_equation_advanced_coherent = | 1240 feature_flags_.blend_equation_advanced_coherent = |
| 1244 blend_equation_advanced_coherent; | 1241 blend_equation_advanced_coherent; |
| 1245 } | 1242 } |
| 1246 } | 1243 } |
| 1247 | 1244 |
| 1248 if (enable_gl_path_rendering_switch_ && | 1245 if (extensions.Contains("GL_NV_framebuffer_mixed_samples")) { |
| 1249 extensions.Contains("GL_NV_framebuffer_mixed_samples")) { | |
| 1250 AddExtensionString("GL_CHROMIUM_framebuffer_mixed_samples"); | 1246 AddExtensionString("GL_CHROMIUM_framebuffer_mixed_samples"); |
| 1251 feature_flags_.chromium_framebuffer_mixed_samples = true; | 1247 feature_flags_.chromium_framebuffer_mixed_samples = true; |
| 1252 validators_.g_l_state.AddValue(GL_COVERAGE_MODULATION_CHROMIUM); | 1248 validators_.g_l_state.AddValue(GL_COVERAGE_MODULATION_CHROMIUM); |
| 1253 } | 1249 } |
| 1254 | 1250 |
| 1255 if (enable_gl_path_rendering_switch_ && | 1251 if (extensions.Contains("GL_NV_path_rendering")) { |
| 1256 extensions.Contains("GL_NV_path_rendering")) { | |
| 1257 bool has_dsa = gl_version_info_->IsAtLeastGL(4, 5) || | 1252 bool has_dsa = gl_version_info_->IsAtLeastGL(4, 5) || |
| 1258 extensions.Contains("GL_EXT_direct_state_access"); | 1253 extensions.Contains("GL_EXT_direct_state_access"); |
| 1259 bool has_piq = gl_version_info_->IsAtLeastGL(4, 3) || | 1254 bool has_piq = gl_version_info_->IsAtLeastGL(4, 3) || |
| 1260 extensions.Contains("GL_ARB_program_interface_query"); | 1255 extensions.Contains("GL_ARB_program_interface_query"); |
| 1261 bool has_fms = feature_flags_.chromium_framebuffer_mixed_samples; | 1256 bool has_fms = feature_flags_.chromium_framebuffer_mixed_samples; |
| 1262 if ((gl_version_info_->IsAtLeastGLES(3, 1) || | 1257 if ((gl_version_info_->IsAtLeastGLES(3, 1) || |
| 1263 (gl_version_info_->IsAtLeastGL(3, 2) && has_dsa && has_piq)) && | 1258 (gl_version_info_->IsAtLeastGL(3, 2) && has_dsa && has_piq)) && |
| 1264 has_fms) { | 1259 has_fms) { |
| 1265 AddExtensionString("GL_CHROMIUM_path_rendering"); | 1260 AddExtensionString("GL_CHROMIUM_path_rendering"); |
| 1266 feature_flags_.chromium_path_rendering = true; | 1261 feature_flags_.chromium_path_rendering = true; |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1438 if (pos == std::string::npos) { | 1433 if (pos == std::string::npos) { |
| 1439 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1434 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 1440 } | 1435 } |
| 1441 } | 1436 } |
| 1442 | 1437 |
| 1443 FeatureInfo::~FeatureInfo() { | 1438 FeatureInfo::~FeatureInfo() { |
| 1444 } | 1439 } |
| 1445 | 1440 |
| 1446 } // namespace gles2 | 1441 } // namespace gles2 |
| 1447 } // namespace gpu | 1442 } // namespace gpu |
| OLD | NEW |