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

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

Issue 2693333003: Don't use a global share group for the passthrough command buffer contexts. (Closed)
Patch Set: Created 3 years, 10 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/service_utils.cc
diff --git a/gpu/command_buffer/service/service_utils.cc b/gpu/command_buffer/service/service_utils.cc
index e8642d762c6b79c85bd1a40e1d743181e439ea03..a3b531160143f9b32bc88a3779ef56353b3324f0 100644
--- a/gpu/command_buffer/service/service_utils.cc
+++ b/gpu/command_buffer/service/service_utils.cc
@@ -4,8 +4,10 @@
#include "gpu/command_buffer/service/service_utils.h"
+#include "base/command_line.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/gpu_preferences.h"
+#include "ui/gl/gl_switches.h"
namespace gpu {
namespace gles2 {
@@ -19,7 +21,32 @@ gl::GLContextAttribs GenerateGLContextAttribs(
attribs.bind_generates_resource = attribs_helper.bind_generates_resource;
attribs.webgl_compatibility_context =
IsWebGLContextType(attribs_helper.context_type);
+
+ // Always use the global texture share group for the passthrough command
+ // decoder
+ attribs.global_texture_share_group = true;
+
+ // Request a specific context version instead of always 3.0
+ if (IsWebGL2OrES3ContextType(attribs_helper.context_type)) {
+ attribs.client_major_es_version = 3;
+ attribs.client_minor_es_version = 0;
+ } else {
+ DCHECK(IsWebGL1OrES2ContextType(attribs_helper.context_type));
+ attribs.client_major_es_version = 2;
+ attribs.client_minor_es_version = 0;
+ }
+ } else {
+ attribs.client_major_es_version = 3;
+ attribs.client_minor_es_version = 0;
}
+
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableES3GLContext)) {
+ // Forcefully disable ES3 contexts
+ attribs.client_major_es_version = 2;
+ attribs.client_minor_es_version = 0;
+ }
+
return attribs;
}

Powered by Google App Engine
This is Rietveld 408576698