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 #ifndef UI_OZONE_PUBLIC_GL_OZONE_H_ | 5 #ifndef UI_OZONE_PUBLIC_GL_OZONE_H_ |
6 #define UI_OZONE_PUBLIC_GL_OZONE_H_ | 6 #define UI_OZONE_PUBLIC_GL_OZONE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 #include "ui/gl/gl_implementation.h" | 12 #include "ui/gl/gl_implementation.h" |
13 #include "ui/gl/gpu_preference.h" | 13 #include "ui/gl/gpu_preference.h" |
14 #include "ui/ozone/ozone_base_export.h" | 14 #include "ui/ozone/ozone_base_export.h" |
15 | 15 |
16 namespace gl { | 16 namespace gl { |
17 class GLContext; | 17 class GLContext; |
18 struct GLContextAttribs; | |
19 class GLShareGroup; | 18 class GLShareGroup; |
20 class GLSurface; | 19 class GLSurface; |
21 } | 20 } |
22 | 21 |
23 namespace ui { | 22 namespace ui { |
24 | 23 |
25 // Interface that has all of the required methods for an Ozone platform to | 24 // Interface that has all of the required methods for an Ozone platform to |
26 // implement a GL implementation. Functions in gl_factory.h and gl_initializer.h | 25 // implement a GL implementation. Functions in gl_factory.h and gl_initializer.h |
27 // will delegate to functions in this interface. | 26 // will delegate to functions in this interface. |
28 class OZONE_BASE_EXPORT GLOzone { | 27 class OZONE_BASE_EXPORT GLOzone { |
(...skipping 17 matching lines...) Expand all Loading... |
46 // EGL, GLX, WGL). Returns true if the information was retrieved successfully. | 45 // EGL, GLX, WGL). Returns true if the information was retrieved successfully. |
47 virtual bool GetGLWindowSystemBindingInfo( | 46 virtual bool GetGLWindowSystemBindingInfo( |
48 gl::GLWindowSystemBindingInfo* info) = 0; | 47 gl::GLWindowSystemBindingInfo* info) = 0; |
49 | 48 |
50 // Creates a GL context that is compatible with the given surface. | 49 // Creates a GL context that is compatible with the given surface. |
51 // |share_group|, if not null, is a group of contexts which the internally | 50 // |share_group|, if not null, is a group of contexts which the internally |
52 // created OpenGL context shares textures and other resources. | 51 // created OpenGL context shares textures and other resources. |
53 virtual scoped_refptr<gl::GLContext> CreateGLContext( | 52 virtual scoped_refptr<gl::GLContext> CreateGLContext( |
54 gl::GLShareGroup* share_group, | 53 gl::GLShareGroup* share_group, |
55 gl::GLSurface* compatible_surface, | 54 gl::GLSurface* compatible_surface, |
56 const gl::GLContextAttribs& attribs) = 0; | 55 gl::GpuPreference gpu_preference) = 0; |
57 | 56 |
58 // Creates a GL surface that renders directly to a view. | 57 // Creates a GL surface that renders directly to a view. |
59 virtual scoped_refptr<gl::GLSurface> CreateViewGLSurface( | 58 virtual scoped_refptr<gl::GLSurface> CreateViewGLSurface( |
60 gfx::AcceleratedWidget window) = 0; | 59 gfx::AcceleratedWidget window) = 0; |
61 | 60 |
62 // Creates a GL surface that renders directly into a window with surfaceless | 61 // Creates a GL surface that renders directly into a window with surfaceless |
63 // semantics. The surface is not backed by any buffers and is used for | 62 // semantics. The surface is not backed by any buffers and is used for |
64 // overlay-only displays. This will return null if surfaceless mode is | 63 // overlay-only displays. This will return null if surfaceless mode is |
65 // unsupported. | 64 // unsupported. |
66 virtual scoped_refptr<gl::GLSurface> CreateSurfacelessViewGLSurface( | 65 virtual scoped_refptr<gl::GLSurface> CreateSurfacelessViewGLSurface( |
67 gfx::AcceleratedWidget window) = 0; | 66 gfx::AcceleratedWidget window) = 0; |
68 | 67 |
69 // Creates a GL surface used for offscreen rendering. | 68 // Creates a GL surface used for offscreen rendering. |
70 virtual scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface( | 69 virtual scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface( |
71 const gfx::Size& size) = 0; | 70 const gfx::Size& size) = 0; |
72 }; | 71 }; |
73 | 72 |
74 } // namespace ui | 73 } // namespace ui |
75 | 74 |
76 #endif // UI_OZONE_PUBLIC_GL_OZONE_H_ | 75 #endif // UI_OZONE_PUBLIC_GL_OZONE_H_ |
OLD | NEW |