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

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

Issue 2710183004: Support GPU VSync when DirectComposition isn't enabled (Closed)
Patch Set: Created 3 years, 9 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 | « gpu/ipc/service/image_transport_surface_win.cc ('k') | ui/gl/init/gl_factory_win.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 <memory>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
11 #include "ui/gfx/geometry/size.h" 12 #include "ui/gfx/geometry/size.h"
12 #include "ui/gfx/native_widget_types.h" 13 #include "ui/gfx/native_widget_types.h"
13 #include "ui/gl/gl_implementation.h" 14 #include "ui/gl/gl_implementation.h"
14 #include "ui/gl/gl_surface_format.h" 15 #include "ui/gl/gl_surface_format.h"
15 #include "ui/gl/gpu_preference.h" 16 #include "ui/gl/gpu_preference.h"
16 #include "ui/gl/init/gl_init_export.h" 17 #include "ui/gl/init/gl_init_export.h"
17 18
19 namespace gfx {
20 class VSyncProvider;
21 } // namespace gfx
22
18 namespace gl { 23 namespace gl {
19 24
20 class GLContext; 25 class GLContext;
21 struct GLContextAttribs; 26 struct GLContextAttribs;
22 class GLShareGroup; 27 class GLShareGroup;
23 class GLSurface; 28 class GLSurface;
24 29
25 namespace init { 30 namespace init {
26 31
27 // Returns a list of allowed GL implementations. The default implementation will 32 // Returns a list of allowed GL implementations. The default implementation will
(...skipping 24 matching lines...) Expand all
52 // created OpenGL context shares textures and other resources. 57 // created OpenGL context shares textures and other resources.
53 GL_INIT_EXPORT scoped_refptr<GLContext> CreateGLContext( 58 GL_INIT_EXPORT scoped_refptr<GLContext> CreateGLContext(
54 GLShareGroup* share_group, 59 GLShareGroup* share_group,
55 GLSurface* compatible_surface, 60 GLSurface* compatible_surface,
56 const GLContextAttribs& attribs); 61 const GLContextAttribs& attribs);
57 62
58 // Creates a GL surface that renders directly to a view. 63 // Creates a GL surface that renders directly to a view.
59 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateViewGLSurface( 64 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateViewGLSurface(
60 gfx::AcceleratedWidget window); 65 gfx::AcceleratedWidget window);
61 66
67 #if defined(OS_WIN)
68 // Creates a GL surface that renders directly into a native window.
69 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateNativeViewGLSurfaceEGL(
70 gfx::AcceleratedWidget window,
71 std::unique_ptr<gfx::VSyncProvider> sync_provider);
72 #endif
73
62 #if defined(USE_OZONE) 74 #if defined(USE_OZONE)
63 // Creates a GL surface that renders directly into a window with surfaceless 75 // Creates a GL surface that renders directly into a window with surfaceless
64 // semantics - there is no default framebuffer and the primary surface must 76 // semantics - there is no default framebuffer and the primary surface must
65 // be presented as an overlay. If surfaceless mode is not supported or 77 // be presented as an overlay. If surfaceless mode is not supported or
66 // enabled it will return a null pointer. 78 // enabled it will return a null pointer.
67 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface( 79 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface(
68 gfx::AcceleratedWidget window); 80 gfx::AcceleratedWidget window);
69 #endif // defined(USE_OZONE) 81 #endif // defined(USE_OZONE)
70 82
71 // Creates a GL surface used for offscreen rendering. 83 // Creates a GL surface used for offscreen rendering.
72 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateOffscreenGLSurface( 84 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateOffscreenGLSurface(
73 const gfx::Size& size); 85 const gfx::Size& size);
74 86
75 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat( 87 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat(
76 const gfx::Size& size, GLSurfaceFormat format); 88 const gfx::Size& size, GLSurfaceFormat format);
77 89
78 } // namespace init 90 } // namespace init
79 } // namespace gl 91 } // namespace gl
80 92
81 #endif // UI_GL_INIT_GL_FACTORY_H_ 93 #endif // UI_GL_INIT_GL_FACTORY_H_
OLDNEW
« no previous file with comments | « gpu/ipc/service/image_transport_surface_win.cc ('k') | ui/gl/init/gl_factory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698