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

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: remove runtime flag unsafeES3APIs from blink webgl module 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
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 06ce1cef4294f85a4642eeb8d3bc751c37b3e05e..904d33580f7c62f4808781ec07260304f665c95a 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -199,8 +199,10 @@ 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;
+
+ // enable_unsafe_es3_apis_switch_ =
+ // command_line->HasSwitch(switches::kEnableUnsafeES3APIs);
// 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,7 +212,7 @@ 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;
@@ -1404,8 +1406,14 @@ void FeatureInfo::InitializeFeatures() {
}
bool FeatureInfo::IsES3Capable() const {
- if (!enable_unsafe_es3_apis_switch_)
+ // if (!enable_unsafe_es3_apis_switch_)
+ // return false;
+ 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;
if (gl_version_info_)
@@ -1477,7 +1485,7 @@ void FeatureInfo::EnableES3Validators() {
kTotalDrawBufferEnums - max_draw_buffers);
}
- unsafe_es3_apis_enabled_ = true;
+ es3_apis_enabled_ = true;
}
bool FeatureInfo::IsWebGLContext() const {

Powered by Google App Engine
This is Rietveld 408576698