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() { | 20 bool InitializeGLOneOff() { |
21 return gfx::GLSurface::InitializeOneOff(); | 21 return GLSurface::InitializeOneOff(); |
22 } | 22 } |
23 | 23 |
24 scoped_refptr<gfx::GLContext> CreateGLContext( | 24 scoped_refptr<GLContext> CreateGLContext(GLShareGroup* share_group, |
25 gfx::GLShareGroup* share_group, | 25 GLSurface* compatible_surface, |
26 gfx::GLSurface* compatible_surface, | 26 GpuPreference gpu_preference) { |
27 gfx::GpuPreference gpu_preference) { | 27 return GLContext::CreateGLContext(share_group, compatible_surface, |
28 return gfx::GLContext::CreateGLContext(share_group, compatible_surface, | 28 gpu_preference); |
29 gpu_preference); | |
30 } | 29 } |
31 | 30 |
32 scoped_refptr<gfx::GLSurface> CreateViewGLSurface( | 31 scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) { |
33 gfx::AcceleratedWidget window) { | 32 return GLSurface::CreateViewGLSurface(window); |
34 return gfx::GLSurface::CreateViewGLSurface(window); | |
35 } | 33 } |
36 | 34 |
37 #if defined(USE_OZONE) | 35 #if defined(USE_OZONE) |
38 scoped_refptr<gfx::GLSurface> CreateSurfacelessViewGLSurface( | 36 scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface( |
39 gfx::AcceleratedWidget window) { | 37 gfx::AcceleratedWidget window) { |
40 return gfx::GLSurface::CreateSurfacelessViewGLSurface(window); | 38 return GLSurface::CreateSurfacelessViewGLSurface(window); |
41 } | 39 } |
42 #endif // defined(USE_OZONE) | 40 #endif // defined(USE_OZONE) |
43 | 41 |
44 scoped_refptr<gfx::GLSurface> CreateOffscreenGLSurface(const gfx::Size& size) { | 42 scoped_refptr<GLSurface> CreateOffscreenGLSurface(const gfx::Size& size) { |
45 return gfx::GLSurface::CreateOffscreenGLSurface(size); | 43 return GLSurface::CreateOffscreenGLSurface(size); |
46 } | 44 } |
47 | 45 |
48 } // namespace init | 46 } // namespace init |
49 } // namespace gl | 47 } // namespace gl |
OLD | NEW |