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

Unified Diff: gpu/command_buffer/service/service_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/service/service_utils.cc
diff --git a/gpu/command_buffer/service/service_utils.cc b/gpu/command_buffer/service/service_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e8642d762c6b79c85bd1a40e1d743181e439ea03
--- /dev/null
+++ b/gpu/command_buffer/service/service_utils.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "gpu/command_buffer/service/service_utils.h"
+
+#include "gpu/command_buffer/common/gles2_cmd_utils.h"
+#include "gpu/command_buffer/service/gpu_preferences.h"
+
+namespace gpu {
+namespace gles2 {
+
+gl::GLContextAttribs GenerateGLContextAttribs(
+ const ContextCreationAttribHelper& attribs_helper,
+ const GpuPreferences& gpu_preferences) {
+ gl::GLContextAttribs attribs;
+ attribs.gpu_preference = attribs_helper.gpu_preference;
+ if (gpu_preferences.use_passthrough_cmd_decoder) {
+ attribs.bind_generates_resource = attribs_helper.bind_generates_resource;
+ attribs.webgl_compatibility_context =
+ IsWebGLContextType(attribs_helper.context_type);
+ }
+ return attribs;
+}
+
+} // namespace gles2
+} // namespace gpu

Powered by Google App Engine
This is Rietveld 408576698