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

Unified Diff: gpu/command_buffer/common/gles2_cmd_utils.cc

Issue 2480373002: Refactor context creation parameters into a struct. (Closed)
Patch Set: address piman's comments Created 4 years, 1 month 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 5bc3a1abca7bbf00a2afaa57b3c0d32ebb33d49e..817efc124367008ba1f9efdd241d5a69f192076d 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils.cc
+++ b/gpu/command_buffer/common/gles2_cmd_utils.cc
@@ -1843,6 +1843,21 @@ const int32_t kContextType = 0x10004;
} // namespace
+bool IsWebGLContextType(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_WEBGL2:
+ return true;
+ case CONTEXT_TYPE_OPENGLES2:
+ case CONTEXT_TYPE_OPENGLES3:
+ return false;
+ }
+
+ NOTREACHED();
+ return false;
+}
+
ContextCreationAttribHelper::ContextCreationAttribHelper()
: gpu_preference(gl::PreferIntegratedGpu),
alpha_size(-1),

Powered by Google App Engine
This is Rietveld 408576698