| OLD | NEW |
| 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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "ui/gfx/geometry/size.h" | 9 #include "ui/gfx/geometry/size.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 11 #include "ui/gl/gpu_preference.h" | 11 #include "ui/gl/gpu_preference.h" |
| 12 #include "ui/gl/init/gl_init_export.h" | 12 #include "ui/gl/init/gl_init_export.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gl { |
| 15 |
| 15 class GLContext; | 16 class GLContext; |
| 16 class GLShareGroup; | 17 class GLShareGroup; |
| 17 class GLSurface; | 18 class GLSurface; |
| 18 }; | |
| 19 | 19 |
| 20 namespace gl { | |
| 21 namespace init { | 20 namespace init { |
| 22 | 21 |
| 23 // Initialize GL bindings. | 22 // Initialize GL bindings. |
| 24 GL_INIT_EXPORT bool InitializeGLOneOff(); | 23 GL_INIT_EXPORT bool InitializeGLOneOff(); |
| 25 | 24 |
| 26 // Create a GL context that is compatible with the given surface. |share_group|, | 25 // Create a GL context that is compatible with the given surface. |share_group|, |
| 27 // if non-NULL, is a group of contexts which the internally created OpenGL | 26 // if non-NULL, is a group of contexts which the internally created OpenGL |
| 28 // context shares textures and other resources. | 27 // context shares textures and other resources. |
| 29 GL_INIT_EXPORT scoped_refptr<gfx::GLContext> CreateGLContext( | 28 GL_INIT_EXPORT scoped_refptr<GLContext> CreateGLContext( |
| 30 gfx::GLShareGroup* share_group, | 29 GLShareGroup* share_group, |
| 31 gfx::GLSurface* compatible_surface, | 30 GLSurface* compatible_surface, |
| 32 gfx::GpuPreference gpu_preference); | 31 GpuPreference gpu_preference); |
| 33 | 32 |
| 34 // Create a GL surface that renders directly to a view. | 33 // Create a GL surface that renders directly to a view. |
| 35 GL_INIT_EXPORT scoped_refptr<gfx::GLSurface> CreateViewGLSurface( | 34 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateViewGLSurface( |
| 36 gfx::AcceleratedWidget window); | 35 gfx::AcceleratedWidget window); |
| 37 | 36 |
| 38 #if defined(USE_OZONE) | 37 #if defined(USE_OZONE) |
| 39 // Create a GL surface that renders directly into a window with surfaceless | 38 // Create a GL surface that renders directly into a window with surfaceless |
| 40 // semantics - there is no default framebuffer and the primary surface must | 39 // semantics - there is no default framebuffer and the primary surface must |
| 41 // be presented as an overlay. If surfaceless mode is not supported or | 40 // be presented as an overlay. If surfaceless mode is not supported or |
| 42 // enabled it will return a null pointer. | 41 // enabled it will return a null pointer. |
| 43 GL_INIT_EXPORT scoped_refptr<gfx::GLSurface> CreateSurfacelessViewGLSurface( | 42 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface( |
| 44 gfx::AcceleratedWidget window); | 43 gfx::AcceleratedWidget window); |
| 45 #endif // defined(USE_OZONE) | 44 #endif // defined(USE_OZONE) |
| 46 | 45 |
| 47 // Create a GL surface used for offscreen rendering. | 46 // Create a GL surface used for offscreen rendering. |
| 48 GL_INIT_EXPORT scoped_refptr<gfx::GLSurface> CreateOffscreenGLSurface( | 47 GL_INIT_EXPORT scoped_refptr<GLSurface> CreateOffscreenGLSurface( |
| 49 const gfx::Size& size); | 48 const gfx::Size& size); |
| 50 | 49 |
| 51 } // namespace init | 50 } // namespace init |
| 52 } // namespace gl | 51 } // namespace gl |
| 53 | 52 |
| 54 #endif // UI_GL_INIT_GL_FACTORY_H_ | 53 #endif // UI_GL_INIT_GL_FACTORY_H_ |
| OLD | NEW |