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

Unified Diff: gpu/command_buffer/common/gles2_cmd_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/common/gles2_cmd_utils.cc
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc
index 6eb9b8e0827283f571e4fe4879ce80b9f9a90feb..129934bfa1f2c0cda1abc35c7165c5ee7dd275d6 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils.cc
+++ b/gpu/command_buffer/common/gles2_cmd_utils.cc
@@ -1878,6 +1878,36 @@ bool IsWebGLContextType(ContextType context_type) {
return false;
}
+bool IsWebGL1OrES2ContextType(ContextType context_type) {
+ // Switch statement to cause a compile-time error if we miss a case.
+ switch (context_type) {
+ case CONTEXT_TYPE_WEBGL1:
+ case CONTEXT_TYPE_OPENGLES2:
+ return true;
+ case CONTEXT_TYPE_WEBGL2:
+ case CONTEXT_TYPE_OPENGLES3:
+ return false;
+ }
+
+ NOTREACHED();
+ return false;
+}
+
+bool IsWebGL2OrES3ContextType(ContextType context_type) {
+ // Switch statement to cause a compile-time error if we miss a case.
+ switch (context_type) {
+ case CONTEXT_TYPE_OPENGLES3:
+ case CONTEXT_TYPE_WEBGL2:
+ return true;
+ case CONTEXT_TYPE_WEBGL1:
+ case CONTEXT_TYPE_OPENGLES2:
+ return false;
+ }
+
+ NOTREACHED();
+ return false;
+}
+
ContextCreationAttribHelper::ContextCreationAttribHelper()
: gpu_preference(gl::PreferIntegratedGpu),
alpha_size(-1),

Powered by Google App Engine
This is Rietveld 408576698