Index: ui/gl/init/gl_factory.cc |
diff --git a/ui/gl/init/gl_factory.cc b/ui/gl/init/gl_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..09cb4ff2ba4dc7e2137930ea702d2d86bca27cdf |
--- /dev/null |
+++ b/ui/gl/init/gl_factory.cc |
@@ -0,0 +1,49 @@ |
+// Copyright 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 "ui/gl/init/gl_factory.h" |
+ |
+#include "ui/gl/gl_context.h" |
+#include "ui/gl/gl_share_group.h" |
+#include "ui/gl/gl_surface.h" |
+ |
+namespace gl { |
+namespace init { |
+ |
+// TODO(kylechar): This file should be replaced with a platform specific |
+// version for X11, Ozone, Windows, Mac and Android. The implementation of each |
+// factory function should be moved into that file and the original static |
+// methods should be removed from GLSurface and GLContext. This file can then |
+// be deleted. |
+ |
+bool InitializeGLOneOff() { |
+ return gfx::GLSurface::InitializeOneOff(); |
+} |
+ |
+scoped_refptr<gfx::GLContext> CreateGLContext( |
+ gfx::GLShareGroup* share_group, |
+ gfx::GLSurface* compatible_surface, |
+ gfx::GpuPreference gpu_preference) { |
+ return gfx::GLContext::CreateGLContext(share_group, compatible_surface, |
+ gpu_preference); |
+} |
+ |
+scoped_refptr<gfx::GLSurface> CreateViewGLSurface( |
+ gfx::AcceleratedWidget window) { |
+ return gfx::GLSurface::CreateViewGLSurface(window); |
+} |
+ |
+#if defined(USE_OZONE) |
+scoped_refptr<gfx::GLSurface> CreateSurfacelessViewGLSurface( |
+ gfx::AcceleratedWidget window) { |
+ return gfx::GLSurface::CreateSurfacelessViewGLSurface(window); |
+} |
+#endif // defined(USE_OZONE) |
+ |
+scoped_refptr<gfx::GLSurface> CreateOffscreenGLSurface(const gfx::Size& size) { |
+ return gfx::GLSurface::CreateOffscreenGLSurface(size); |
+} |
+ |
+} // namespace init |
+} // namespace gl |