OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gl/init/gl_factory.h" | 5 #include "ui/gl/init/gl_factory.h" |
6 | 6 |
7 #include "ui/gl/gl_context.h" | 7 #include "ui/gl/gl_context.h" |
8 #include "ui/gl/gl_share_group.h" | 8 #include "ui/gl/gl_share_group.h" |
9 #include "ui/gl/gl_surface.h" | 9 #include "ui/gl/gl_surface.h" |
10 | 10 |
11 namespace gl { | 11 namespace gl { |
12 namespace init { | 12 namespace init { |
13 | 13 |
14 // TODO(kylechar): This file should be replaced with a platform specific | 14 // TODO(kylechar): This file should be replaced with a platform specific |
15 // version for X11, Ozone, Windows, Mac and Android. The implementation of each | 15 // version for X11, Ozone, Windows, Mac and Android. The implementation of each |
16 // factory function should be moved into that file and the original static | 16 // factory function should be moved into that file and the original static |
17 // methods should be removed from GLSurface and GLContext. This file can then | 17 // methods should be removed from GLSurface and GLContext. This file can then |
18 // be deleted. | 18 // be deleted. |
19 | 19 |
20 bool InitializeGLOneOff() { | |
21 return GLSurface::InitializeOneOff(); | |
22 } | |
23 | |
24 scoped_refptr<GLContext> CreateGLContext(GLShareGroup* share_group, | 20 scoped_refptr<GLContext> CreateGLContext(GLShareGroup* share_group, |
25 GLSurface* compatible_surface, | 21 GLSurface* compatible_surface, |
26 GpuPreference gpu_preference) { | 22 GpuPreference gpu_preference) { |
27 return GLContext::CreateGLContext(share_group, compatible_surface, | 23 return GLContext::CreateGLContext(share_group, compatible_surface, |
28 gpu_preference); | 24 gpu_preference); |
29 } | 25 } |
30 | 26 |
31 scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) { | 27 scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) { |
32 return GLSurface::CreateViewGLSurface(window); | 28 return GLSurface::CreateViewGLSurface(window); |
33 } | 29 } |
34 | 30 |
35 #if defined(USE_OZONE) | 31 #if defined(USE_OZONE) |
36 scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface( | 32 scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface( |
37 gfx::AcceleratedWidget window) { | 33 gfx::AcceleratedWidget window) { |
38 return GLSurface::CreateSurfacelessViewGLSurface(window); | 34 return GLSurface::CreateSurfacelessViewGLSurface(window); |
39 } | 35 } |
40 #endif // defined(USE_OZONE) | 36 #endif // defined(USE_OZONE) |
41 | 37 |
42 scoped_refptr<GLSurface> CreateOffscreenGLSurface(const gfx::Size& size) { | 38 scoped_refptr<GLSurface> CreateOffscreenGLSurface(const gfx::Size& size) { |
43 return GLSurface::CreateOffscreenGLSurface(size); | 39 return GLSurface::CreateOffscreenGLSurface(size); |
44 } | 40 } |
45 | 41 |
46 } // namespace init | 42 } // namespace init |
47 } // namespace gl | 43 } // namespace gl |
OLD | NEW |