Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: gpu/command_buffer/service/feature_info.cc

Issue 169403005: command_buffer: Implement path rendering functions for CHROMIUM_path_rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nv-pr-02-texgen
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 extensions.Contains("GL_NV_path_rendering")) {
1009 gl_version_info_->is_es3) { 1012 bool hasNeededOptionalFunctions =
1013 gfx::GetGLProcAddress("glStencilThenCoverFillPathNV") &&
1014 gfx::GetGLProcAddress("glStencilThenCoverStrokePathNV");
piman 2015/06/27 01:20:07 Why is this needed?
Kimmo Kinnunen 2015/06/29 05:46:04 These required functions are part of the API versi
piman 2015/06/29 23:31:17 I don't much like this idea of extension "API vers
1015
1016 if (hasNeededOptionalFunctions &&
1017 (extensions.Contains("GL_EXT_direct_state_access") ||
1018 gl_version_info_->is_es3)) {
1010 AddExtensionString("GL_CHROMIUM_path_rendering"); 1019 AddExtensionString("GL_CHROMIUM_path_rendering");
1011 feature_flags_.chromium_path_rendering = true; 1020 feature_flags_.chromium_path_rendering = true;
1012 validators_.g_l_state.AddValue(GL_PATH_MODELVIEW_MATRIX_CHROMIUM); 1021 validators_.g_l_state.AddValue(GL_PATH_MODELVIEW_MATRIX_CHROMIUM);
1013 validators_.g_l_state.AddValue(GL_PATH_PROJECTION_MATRIX_CHROMIUM); 1022 validators_.g_l_state.AddValue(GL_PATH_PROJECTION_MATRIX_CHROMIUM);
1023 validators_.g_l_state.AddValue(GL_PATH_STENCIL_FUNC_CHROMIUM);
1024 validators_.g_l_state.AddValue(GL_PATH_STENCIL_REF_CHROMIUM);
1025 validators_.g_l_state.AddValue(GL_PATH_STENCIL_VALUE_MASK_CHROMIUM);
1014 } 1026 }
1015 } 1027 }
1016 1028
1017 if ((gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile || 1029 if ((gl_version_info_->is_es3 || gl_version_info_->is_desktop_core_profile ||
1018 extensions.Contains("GL_EXT_texture_rg") || 1030 extensions.Contains("GL_EXT_texture_rg") ||
1019 extensions.Contains("GL_ARB_texture_rg")) && 1031 extensions.Contains("GL_ARB_texture_rg")) &&
1020 IsGL_REDSupportedOnFBOs()) { 1032 IsGL_REDSupportedOnFBOs()) {
1021 feature_flags_.ext_texture_rg = true; 1033 feature_flags_.ext_texture_rg = true;
1022 AddExtensionString("GL_EXT_texture_rg"); 1034 AddExtensionString("GL_EXT_texture_rg");
1023 1035
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 if (pos == std::string::npos) { 1145 if (pos == std::string::npos) {
1134 extensions_ += (extensions_.empty() ? "" : " ") + str; 1146 extensions_ += (extensions_.empty() ? "" : " ") + str;
1135 } 1147 }
1136 } 1148 }
1137 1149
1138 FeatureInfo::~FeatureInfo() { 1150 FeatureInfo::~FeatureInfo() {
1139 } 1151 }
1140 1152
1141 } // namespace gles2 1153 } // namespace gles2
1142 } // namespace gpu 1154 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698