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

Side by Side Diff: ui/gl/init/gl_factory.h

Issue 2497503004: Revert of Refactor context creation parameters into a struct. (Closed)
Patch Set: 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
« no previous file with comments | « ui/gl/gl_surface_egl.cc ('k') | ui/gl/init/gl_factory_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_GL_INIT_GL_FACTORY_H_ 5 #ifndef UI_GL_INIT_GL_FACTORY_H_
6 #define UI_GL_INIT_GL_FACTORY_H_ 6 #define UI_GL_INIT_GL_FACTORY_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "ui/gfx/geometry/size.h" 11 #include "ui/gfx/geometry/size.h"
12 #include "ui/gfx/native_widget_types.h" 12 #include "ui/gfx/native_widget_types.h"
13 #include "ui/gl/gl_implementation.h" 13 #include "ui/gl/gl_implementation.h"
14 #include "ui/gl/gpu_preference.h" 14 #include "ui/gl/gpu_preference.h"
15 #include "ui/gl/init/gl_init_export.h" 15 #include "ui/gl/init/gl_init_export.h"
16 16
17 namespace gl { 17 namespace gl {
18 18
19 class GLContext; 19 class GLContext;
20 struct GLContextAttribs;
21 class GLShareGroup; 20 class GLShareGroup;
22 class GLSurface; 21 class GLSurface;
23 22
24 namespace init { 23 namespace init {
25 24
26 // Returns a list of allowed GL implementations. The default implementation will 25 // Returns a list of allowed GL implementations. The default implementation will
27 // be the first item. 26 // be the first item.
28 GL_INIT_EXPORT std::vector<GLImplementation> GetAllowedGLImplementations(); 27 GL_INIT_EXPORT std::vector<GLImplementation> GetAllowedGLImplementations();
29 28
30 // Initializes GL bindings. 29 // Initializes GL bindings.
(...skipping 13 matching lines...) Expand all
44 // EGL, GLX, WGL). Returns true if the information was retrieved successfully. 43 // EGL, GLX, WGL). Returns true if the information was retrieved successfully.
45 GL_INIT_EXPORT bool GetGLWindowSystemBindingInfo( 44 GL_INIT_EXPORT bool GetGLWindowSystemBindingInfo(
46 GLWindowSystemBindingInfo* info); 45 GLWindowSystemBindingInfo* info);
47 46
48 // Creates a GL context that is compatible with the given surface. 47 // Creates a GL context that is compatible with the given surface.
49 // |share_group|, if non-null, is a group of contexts which the internally 48 // |share_group|, if non-null, is a group of contexts which the internally
50 // created OpenGL context shares textures and other resources. 49 // created OpenGL context shares textures and other resources.
51 GL_INIT_EXPORT scoped_refptr<GLContext> CreateGLContext( 50 GL_INIT_EXPORT scoped_refptr<GLContext> CreateGLContext(
52 GLShareGroup* share_group, 51 GLShareGroup* share_group,
53 GLSurface* compatible_surface, 52 GLSurface* compatible_surface,
54 const GLContextAttribs& attribs); 53 GpuPreference gpu_preference);
55 54
56 // Creates a GL surface that renders directly to a view. 55 // Creates a GL surface that renders directly to a view.
57 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateViewGLSurface( 56 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateViewGLSurface(
58 gfx::AcceleratedWidget window); 57 gfx::AcceleratedWidget window);
59 58
60 #if defined(USE_OZONE) 59 #if defined(USE_OZONE)
61 // Creates a GL surface that renders directly into a window with surfaceless 60 // Creates a GL surface that renders directly into a window with surfaceless
62 // semantics - there is no default framebuffer and the primary surface must 61 // semantics - there is no default framebuffer and the primary surface must
63 // be presented as an overlay. If surfaceless mode is not supported or 62 // be presented as an overlay. If surfaceless mode is not supported or
64 // enabled it will return a null pointer. 63 // enabled it will return a null pointer.
65 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface( 64 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface(
66 gfx::AcceleratedWidget window); 65 gfx::AcceleratedWidget window);
67 #endif // defined(USE_OZONE) 66 #endif // defined(USE_OZONE)
68 67
69 // Creates a GL surface used for offscreen rendering. 68 // Creates a GL surface used for offscreen rendering.
70 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateOffscreenGLSurface( 69 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateOffscreenGLSurface(
71 const gfx::Size& size); 70 const gfx::Size& size);
72 71
73 } // namespace init 72 } // namespace init
74 } // namespace gl 73 } // namespace gl
75 74
76 #endif // UI_GL_INIT_GL_FACTORY_H_ 75 #endif // UI_GL_INIT_GL_FACTORY_H_
OLDNEW
« no previous file with comments | « ui/gl/gl_surface_egl.cc ('k') | ui/gl/init/gl_factory_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698