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

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

Issue 2480373002: Refactor context creation parameters into a struct. (Closed)
Patch Set: address piman's comments Created 4 years, 1 month 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
OLDNEW
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;
18 class GLShareGroup; 19 class GLShareGroup;
19 class GLSurface; 20 class GLSurface;
20 } 21 }
21 22
22 namespace ui { 23 namespace ui {
23 24
24 // Interface that has all of the required methods for an Ozone platform to 25 // 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 // implement a GL implementation. Functions in gl_factory.h and gl_initializer.h
26 // will delegate to functions in this interface. 27 // will delegate to functions in this interface.
27 class OZONE_BASE_EXPORT GLOzone { 28 class OZONE_BASE_EXPORT GLOzone {
(...skipping 17 matching lines...) Expand all
45 // EGL, GLX, WGL). Returns true if the information was retrieved successfully. 46 // EGL, GLX, WGL). Returns true if the information was retrieved successfully.
46 virtual bool GetGLWindowSystemBindingInfo( 47 virtual bool GetGLWindowSystemBindingInfo(
47 gl::GLWindowSystemBindingInfo* info) = 0; 48 gl::GLWindowSystemBindingInfo* info) = 0;
48 49
49 // Creates a GL context that is compatible with the given surface. 50 // 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 // |share_group|, if not null, is a group of contexts which the internally
51 // created OpenGL context shares textures and other resources. 52 // created OpenGL context shares textures and other resources.
52 virtual scoped_refptr<gl::GLContext> CreateGLContext( 53 virtual scoped_refptr<gl::GLContext> CreateGLContext(
53 gl::GLShareGroup* share_group, 54 gl::GLShareGroup* share_group,
54 gl::GLSurface* compatible_surface, 55 gl::GLSurface* compatible_surface,
55 gl::GpuPreference gpu_preference) = 0; 56 const gl::GLContextAttribs& attribs) = 0;
56 57
57 // Creates a GL surface that renders directly to a view. 58 // Creates a GL surface that renders directly to a view.
58 virtual scoped_refptr<gl::GLSurface> CreateViewGLSurface( 59 virtual scoped_refptr<gl::GLSurface> CreateViewGLSurface(
59 gfx::AcceleratedWidget window) = 0; 60 gfx::AcceleratedWidget window) = 0;
60 61
61 // Creates a GL surface that renders directly into a window with surfaceless 62 // 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 // 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 // overlay-only displays. This will return null if surfaceless mode is
64 // unsupported. 65 // unsupported.
65 virtual scoped_refptr<gl::GLSurface> CreateSurfacelessViewGLSurface( 66 virtual scoped_refptr<gl::GLSurface> CreateSurfacelessViewGLSurface(
66 gfx::AcceleratedWidget window) = 0; 67 gfx::AcceleratedWidget window) = 0;
67 68
68 // Creates a GL surface used for offscreen rendering. 69 // Creates a GL surface used for offscreen rendering.
69 virtual scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface( 70 virtual scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface(
70 const gfx::Size& size) = 0; 71 const gfx::Size& size) = 0;
71 }; 72 };
72 73
73 } // namespace ui 74 } // namespace ui
74 75
75 #endif // UI_OZONE_PUBLIC_GL_OZONE_H_ 76 #endif // UI_OZONE_PUBLIC_GL_OZONE_H_
OLDNEW
« android_webview/browser/test/fake_window.cc ('K') | « ui/ozone/platform/x11/gl_ozone_glx.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698