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 <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 feature_flags_.is_swiftshader = | 203 feature_flags_.is_swiftshader = |
204 (command_line.GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); | 204 (command_line.GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); |
205 | 205 |
206 feature_flags_.enable_subscribe_uniform = | 206 feature_flags_.enable_subscribe_uniform = |
207 command_line.HasSwitch(switches::kEnableSubscribeUniformExtension); | 207 command_line.HasSwitch(switches::kEnableSubscribeUniformExtension); |
208 | 208 |
209 enable_unsafe_es3_apis_switch_ = | 209 enable_unsafe_es3_apis_switch_ = |
210 command_line.HasSwitch(switches::kEnableUnsafeES3APIs); | 210 command_line.HasSwitch(switches::kEnableUnsafeES3APIs); |
211 | 211 |
| 212 enable_gl_path_rendering_switch_ = |
| 213 command_line.HasSwitch(switches::kEnableGLPathRendering); |
| 214 |
212 unsafe_es3_apis_enabled_ = false; | 215 unsafe_es3_apis_enabled_ = false; |
213 } | 216 } |
214 | 217 |
215 bool FeatureInfo::Initialize() { | 218 bool FeatureInfo::Initialize() { |
216 disallowed_features_ = DisallowedFeatures(); | 219 disallowed_features_ = DisallowedFeatures(); |
217 InitializeFeatures(); | 220 InitializeFeatures(); |
218 return true; | 221 return true; |
219 } | 222 } |
220 | 223 |
221 bool FeatureInfo::Initialize(const DisallowedFeatures& disallowed_features) { | 224 bool FeatureInfo::Initialize(const DisallowedFeatures& disallowed_features) { |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 if (blend_equation_advanced_coherent) | 1000 if (blend_equation_advanced_coherent) |
998 AddExtensionString("GL_KHR_blend_equation_advanced_coherent"); | 1001 AddExtensionString("GL_KHR_blend_equation_advanced_coherent"); |
999 | 1002 |
1000 AddExtensionString("GL_KHR_blend_equation_advanced"); | 1003 AddExtensionString("GL_KHR_blend_equation_advanced"); |
1001 feature_flags_.blend_equation_advanced = true; | 1004 feature_flags_.blend_equation_advanced = true; |
1002 feature_flags_.blend_equation_advanced_coherent = | 1005 feature_flags_.blend_equation_advanced_coherent = |
1003 blend_equation_advanced_coherent; | 1006 blend_equation_advanced_coherent; |
1004 } | 1007 } |
1005 } | 1008 } |
1006 | 1009 |
1007 if (extensions.Contains("GL_NV_path_rendering")) { | 1010 if (enable_gl_path_rendering_switch_ && |
1008 if (extensions.Contains("GL_EXT_direct_state_access") || | 1011 !workarounds_.disable_gl_path_rendering && |
1009 gl_version_info_->is_es3) { | 1012 extensions.Contains("GL_NV_path_rendering") && |
1010 AddExtensionString("GL_CHROMIUM_path_rendering"); | 1013 (extensions.Contains("GL_EXT_direct_state_access") || |
1011 feature_flags_.chromium_path_rendering = true; | 1014 gl_version_info_->is_es3)) { |
1012 validators_.g_l_state.AddValue(GL_PATH_MODELVIEW_MATRIX_CHROMIUM); | 1015 AddExtensionString("GL_CHROMIUM_path_rendering"); |
1013 validators_.g_l_state.AddValue(GL_PATH_PROJECTION_MATRIX_CHROMIUM); | 1016 feature_flags_.chromium_path_rendering = true; |
1014 } | 1017 validators_.g_l_state.AddValue(GL_PATH_MODELVIEW_MATRIX_CHROMIUM); |
| 1018 validators_.g_l_state.AddValue(GL_PATH_PROJECTION_MATRIX_CHROMIUM); |
| 1019 validators_.g_l_state.AddValue(GL_PATH_STENCIL_FUNC_CHROMIUM); |
| 1020 validators_.g_l_state.AddValue(GL_PATH_STENCIL_REF_CHROMIUM); |
| 1021 validators_.g_l_state.AddValue(GL_PATH_STENCIL_VALUE_MASK_CHROMIUM); |
1015 } | 1022 } |
1016 | 1023 |
1017 if ((gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile || | 1024 if ((gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile || |
1018 extensions.Contains("GL_EXT_texture_rg") || | 1025 extensions.Contains("GL_EXT_texture_rg") || |
1019 extensions.Contains("GL_ARB_texture_rg")) && | 1026 extensions.Contains("GL_ARB_texture_rg")) && |
1020 IsGL_REDSupportedOnFBOs()) { | 1027 IsGL_REDSupportedOnFBOs()) { |
1021 feature_flags_.ext_texture_rg = true; | 1028 feature_flags_.ext_texture_rg = true; |
1022 AddExtensionString("GL_EXT_texture_rg"); | 1029 AddExtensionString("GL_EXT_texture_rg"); |
1023 | 1030 |
1024 validators_.texture_format.AddValue(GL_RED_EXT); | 1031 validators_.texture_format.AddValue(GL_RED_EXT); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 if (pos == std::string::npos) { | 1140 if (pos == std::string::npos) { |
1134 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1141 extensions_ += (extensions_.empty() ? "" : " ") + str; |
1135 } | 1142 } |
1136 } | 1143 } |
1137 | 1144 |
1138 FeatureInfo::~FeatureInfo() { | 1145 FeatureInfo::~FeatureInfo() { |
1139 } | 1146 } |
1140 | 1147 |
1141 } // namespace gles2 | 1148 } // namespace gles2 |
1142 } // namespace gpu | 1149 } // namespace gpu |
OLD | NEW |