Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: ui/ozone/public/gl_ozone.h

Issue 2270463002: Add OzoneGLImpl interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/ozone/platform/x11/x11_surface_factory.cc ('k') | ui/ozone/public/surface_factory_ozone.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_OZONE_PUBLIC_GL_OZONE_H_
6 #define UI_OZONE_PUBLIC_GL_OZONE_H_
7
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "ui/gfx/geometry/size.h"
11 #include "ui/gfx/native_widget_types.h"
12 #include "ui/gl/gl_implementation.h"
13 #include "ui/gl/gpu_preference.h"
14 #include "ui/ozone/ozone_base_export.h"
15
16 namespace gl {
17 class GLContext;
18 class GLShareGroup;
19 class GLSurface;
20 }
21
22 namespace ui {
23
24 // Interface that has all of the required methods for an Ozone platform to
25 // implement a GL implementation. Functions in gl_factory.h and gl_initializer.h
26 // will delegate to functions in this interface.
27 class OZONE_BASE_EXPORT GLOzone {
28 public:
29 virtual ~GLOzone() {}
30
31 // Initializes static GL bindings and sets GL implementation.
32 virtual bool InitializeStaticGLBindings(
33 gl::GLImplementation implementation) = 0;
34
35 // Performs any one off initialization for GL implementation.
36 virtual bool InitializeGLOneOffPlatform() = 0;
37
38 // Initializes static debug GL bindings.
39 virtual void InitializeDebugGLBindings() = 0;
40
41 // Clears static GL bindings.
42 virtual void ClearGLBindings() = 0;
43
44 // Returns information about the GL window system binding implementation (eg.
45 // EGL, GLX, WGL). Returns true if the information was retrieved successfully.
46 virtual bool GetGLWindowSystemBindingInfo(
47 gl::GLWindowSystemBindingInfo* info) = 0;
48
49 // Creates a GL context that is compatible with the given surface.
50 // |share_group|, if not null, is a group of contexts which the internally
51 // created OpenGL context shares textures and other resources.
52 virtual scoped_refptr<gl::GLContext> CreateGLContext(
53 gl::GLShareGroup* share_group,
54 gl::GLSurface* compatible_surface,
55 gl::GpuPreference gpu_preference) = 0;
56
57 // Creates a GL surface that renders directly to a view.
58 virtual scoped_refptr<gl::GLSurface> CreateViewGLSurface(
59 gfx::AcceleratedWidget window) = 0;
60
61 // Creates a GL surface that renders directly into a window with surfaceless
62 // semantics. The surface is not backed by any buffers and is used for
63 // overlay-only displays. This will return null if surfaceless mode is
64 // unsupported.
65 virtual scoped_refptr<gl::GLSurface> CreateSurfacelessViewGLSurface(
66 gfx::AcceleratedWidget window) = 0;
67
68 // Creates a GL surface used for offscreen rendering.
69 virtual scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface(
70 const gfx::Size& size) = 0;
71 };
72
73 } // namespace ui
74
75 #endif // UI_OZONE_PUBLIC_GL_OZONE_H_
OLDNEW
« no previous file with comments | « ui/ozone/platform/x11/x11_surface_factory.cc ('k') | ui/ozone/public/surface_factory_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698