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

Side by Side Diff: ui/gl/init/gl_factory.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_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;
20 class GLShareGroup; 21 class GLShareGroup;
21 class GLSurface; 22 class GLSurface;
22 23
23 namespace init { 24 namespace init {
24 25
25 // Returns a list of allowed GL implementations. The default implementation will 26 // Returns a list of allowed GL implementations. The default implementation will
26 // be the first item. 27 // be the first item.
27 GL_INIT_EXPORT std::vector<GLImplementation> GetAllowedGLImplementations(); 28 GL_INIT_EXPORT std::vector<GLImplementation> GetAllowedGLImplementations();
28 29
29 // Initializes GL bindings. 30 // Initializes GL bindings.
(...skipping 13 matching lines...) Expand all
43 // EGL, GLX, WGL). Returns true if the information was retrieved successfully. 44 // EGL, GLX, WGL). Returns true if the information was retrieved successfully.
44 GL_INIT_EXPORT bool GetGLWindowSystemBindingInfo( 45 GL_INIT_EXPORT bool GetGLWindowSystemBindingInfo(
45 GLWindowSystemBindingInfo* info); 46 GLWindowSystemBindingInfo* info);
46 47
47 // Creates a GL context that is compatible with the given surface. 48 // Creates a GL context that is compatible with the given surface.
48 // |share_group|, if non-null, is a group of contexts which the internally 49 // |share_group|, if non-null, is a group of contexts which the internally
49 // created OpenGL context shares textures and other resources. 50 // created OpenGL context shares textures and other resources.
50 GL_INIT_EXPORT scoped_refptr<GLContext> CreateGLContext( 51 GL_INIT_EXPORT scoped_refptr<GLContext> CreateGLContext(
51 GLShareGroup* share_group, 52 GLShareGroup* share_group,
52 GLSurface* compatible_surface, 53 GLSurface* compatible_surface,
53 GpuPreference gpu_preference); 54 const GLContextAttribs& attribs);
54 55
55 // Creates a GL surface that renders directly to a view. 56 // Creates a GL surface that renders directly to a view.
56 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateViewGLSurface( 57 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateViewGLSurface(
57 gfx::AcceleratedWidget window); 58 gfx::AcceleratedWidget window);
58 59
59 #if defined(USE_OZONE) 60 #if defined(USE_OZONE)
60 // 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
61 // semantics - there is no default framebuffer and the primary surface must 62 // semantics - there is no default framebuffer and the primary surface must
62 // be presented as an overlay. If surfaceless mode is not supported or 63 // be presented as an overlay. If surfaceless mode is not supported or
63 // enabled it will return a null pointer. 64 // enabled it will return a null pointer.
64 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface( 65 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface(
65 gfx::AcceleratedWidget window); 66 gfx::AcceleratedWidget window);
66 #endif // defined(USE_OZONE) 67 #endif // defined(USE_OZONE)
67 68
68 // Creates a GL surface used for offscreen rendering. 69 // Creates a GL surface used for offscreen rendering.
69 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateOffscreenGLSurface( 70 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateOffscreenGLSurface(
70 const gfx::Size& size); 71 const gfx::Size& size);
71 72
72 } // namespace init 73 } // namespace init
73 } // namespace gl 74 } // namespace gl
74 75
75 #endif // UI_GL_INIT_GL_FACTORY_H_ 76 #endif // UI_GL_INIT_GL_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698