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

Unified Diff: gpu/command_buffer/service/feature_info.cc

Issue 2444813002: Remove unsafe mode to enable es3 api by default for WebGL2 and ES3 context (Closed)
Patch Set: fix a bug Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/feature_info.cc
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index d30abaa72f216f6d547b875e8f998619eaad3d3a..d47eea5c26a98ad26991df6ec60ea046565dcb94 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -199,8 +199,7 @@ void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) {
feature_flags_.is_swiftshader =
(command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader");
- enable_unsafe_es3_apis_switch_ =
- command_line->HasSwitch(switches::kEnableUnsafeES3APIs);
+ enable_es3_apis_switch_ = true;
// The shader translator is needed to translate from WebGL-conformant GLES SL
// to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to
@@ -210,10 +209,10 @@ void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) {
disable_shader_translator_ =
command_line->HasSwitch(switches::kDisableGLSLTranslator);
- unsafe_es3_apis_enabled_ = false;
+ es3_apis_enabled_ = false;
// Default context_type_ to a GLES2 Context.
- context_type_ = CONTEXT_TYPE_OPENGLES2;
+ context_type_ = CONTEXT_TYPE_OPENGLES2; // ??
ext_color_buffer_float_available_ = false;
oes_texture_float_linear_available_ = false;
@@ -1410,7 +1409,10 @@ void FeatureInfo::InitializeFeatures() {
}
bool FeatureInfo::IsES3Capable() const {
- if (!enable_unsafe_es3_apis_switch_)
+ if (!enable_es3_apis_switch_)
+ return false;
+ if (context_type_ != CONTEXT_TYPE_WEBGL2 &&
+ context_type_ != CONTEXT_TYPE_OPENGLES3)
return false;
if (workarounds_.disable_texture_storage)
return false;
@@ -1491,7 +1493,7 @@ void FeatureInfo::EnableES3Validators() {
GL_BGRA8_EXT);
}
- unsafe_es3_apis_enabled_ = true;
+ es3_apis_enabled_ = true;
}
bool FeatureInfo::IsWebGLContext() const {
« no previous file with comments | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698