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..8d5761fe2ef951e93792ff6d4acd14199ec2d422 |
--- /dev/null |
+++ b/gpu/command_buffer/service/service_utils.cc |
@@ -0,0 +1,26 @@ |
+// 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; |
+ attribs.bind_generates_resource = attribs_helper.bind_generates_resource; |
+ attribs.webgl_compatibility_context = |
+ gpu_preferences.use_passthrough_cmd_decoder && |
+ IsWebGLContextType(attribs_helper.context_type); |
+ return attribs; |
+} |
+ |
+} // namespace gles2 |
+} // namespace gpu |