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

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

Issue 2270463002: Add OzoneGLImpl interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename. Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_SURFACE_FACTORY_OZONE_H_ 5 #ifndef UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_
6 #define UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ 6 #define UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/native_library.h" 16 #include "base/native_library.h"
17 #include "ui/gfx/buffer_types.h" 17 #include "ui/gfx/buffer_types.h"
18 #include "ui/gfx/geometry/rect.h" 18 #include "ui/gfx/geometry/rect.h"
19 #include "ui/gfx/native_widget_types.h" 19 #include "ui/gfx/native_widget_types.h"
20 #include "ui/gfx/overlay_transform.h" 20 #include "ui/gfx/overlay_transform.h"
21 #include "ui/gl/gl_implementation.h" 21 #include "ui/gl/gl_implementation.h"
22 #include "ui/gl/gl_surface.h" 22 #include "ui/gl/gl_surface.h"
23 #include "ui/ozone/ozone_base_export.h" 23 #include "ui/ozone/ozone_base_export.h"
24 #include "ui/ozone/public/gl_ozone.h"
24 #include "ui/ozone/public/native_pixmap.h" 25 #include "ui/ozone/public/native_pixmap.h"
25 26
26 namespace ui { 27 namespace ui {
27 28
28 class NativePixmap; 29 class NativePixmap;
29 class SurfaceOzoneCanvas; 30 class SurfaceOzoneCanvas;
30 31
31 // The Ozone interface allows external implementations to hook into Chromium to 32 // The Ozone interface allows external implementations to hook into Chromium to
32 // provide a system specific implementation. The Ozone interface supports two 33 // provide a system specific implementation. The Ozone interface supports two
33 // drawing modes: 1) accelerated drawing using GL and 2) software drawing 34 // drawing modes: 1) accelerated drawing using GL and 2) software drawing
34 // through Skia. 35 // through Skia.
35 // 36 //
36 // If you want to paint on a window with ozone, you need to create a GLSurface 37 // If you want to paint on a window with ozone, you need to create a GLSurface
37 // or SurfaceOzoneCanvas for that window. The platform can support software, GL, 38 // or SurfaceOzoneCanvas for that window. The platform can support software, GL,
38 // or both for painting on the window. The following functionality is specific 39 // or both for painting on the window. The following functionality is specific
39 // to the drawing mode and may not have any meaningful implementation in the 40 // to the drawing mode and may not have any meaningful implementation in the
40 // other mode. An implementation must provide functionality for at least one 41 // other mode. An implementation must provide functionality for at least one
41 // mode. 42 // mode.
42 // 43 //
43 // 1) Accelerated Drawing (GL path): 44 // 1) Accelerated Drawing (GL path):
44 // 45 //
45 // The following functions are specific to GL: 46 // The following functions are specific to GL:
46 // - GetNativeDisplay (EGL only) 47 // - GetAllowedGLImplementations
47 // - LoadEGLGLES2Bindings (EGL only) 48 // - GetOzoneGLementation (along with the associated GLOzone)
48 // - CreateViewGLSurface (all GL implementations)
49 // - CreateSurfacelessViewGLSurface (EGL only)
50 // - CreateOffscreenGLSurface (all GL implementations)
51 // 49 //
52 // 2) Software Drawing (Skia): 50 // 2) Software Drawing (Skia):
53 // 51 //
54 // The following function is specific to the software path: 52 // The following function is specific to the software path:
55 // - CreateCanvasForWidget 53 // - CreateCanvasForWidget
56 // 54 //
57 // The accelerated path can optionally provide support for the software drawing 55 // The accelerated path can optionally provide support for the software drawing
58 // path. 56 // path.
59 // 57 //
60 // The remaining functions are not covered since they are needed in both drawing 58 // The remaining functions are not covered since they are needed in both drawing
61 // modes (See comments bellow for descriptions). 59 // modes (See comments bellow for descriptions).
62 class OZONE_BASE_EXPORT SurfaceFactoryOzone { 60 class OZONE_BASE_EXPORT SurfaceFactoryOzone {
63 public: 61 public:
64 // Returns native platform display handle. This is used to obtain the EGL 62 // Returns a list of allowed GL implementations. The default implementation
65 // display connection for the native display. 63 // will be the first item.
64 virtual std::vector<gl::GLImplementation> GetAllowedGLImplementations();
rjkroege 2016/08/26 19:55:53 How hard to you think that it would be move this i
kylechar 2016/08/29 15:38:15 Not super hard but I don't think it's worth it. Th
65
66 // Returns the GLOzone to use for the specified GL implementation, or null if
67 // GL implementation doesn't exist.
68 virtual GLOzone* GetGLOzone(gl::GLImplementation implemenation);
69
70 // DEPRECATED(kylechar): Implement GLOzoneEGL instead.
66 virtual intptr_t GetNativeDisplay(); 71 virtual intptr_t GetNativeDisplay();
67 72
68 // Creates a GL surface that renders directly to a view for the specified GL 73 // DEPRECATED(kylechar): Implement GLOzone instead.
69 // implementation.
70 virtual scoped_refptr<gl::GLSurface> CreateViewGLSurface( 74 virtual scoped_refptr<gl::GLSurface> CreateViewGLSurface(
71 gl::GLImplementation implementation, 75 gl::GLImplementation implementation,
72 gfx::AcceleratedWidget widget); 76 gfx::AcceleratedWidget widget);
73 77
74 // Creates a GL surface that renders directly into a window with surfaceless 78 // DEPRECATED(kylechar): Implement GLOzone instead.
75 // semantics for the specified GL implementation. The surface is not backed
76 // by any buffers and is used for overlay-only displays. This will return
77 // nullptr if surfaceless mode unsupported.
78 virtual scoped_refptr<gl::GLSurface> CreateSurfacelessViewGLSurface( 79 virtual scoped_refptr<gl::GLSurface> CreateSurfacelessViewGLSurface(
79 gl::GLImplementation implementation, 80 gl::GLImplementation implementation,
80 gfx::AcceleratedWidget widget); 81 gfx::AcceleratedWidget widget);
81 82
82 // Creates a GL surface used for offscreen rendering for the specified GL 83 // DEPRECATED(kylechar): Implement GLOzone instead.
83 // implementation.
84 virtual scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface( 84 virtual scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface(
85 gl::GLImplementation implementation, 85 gl::GLImplementation implementation,
86 const gfx::Size& size); 86 const gfx::Size& size);
87 87
88 // Create SurfaceOzoneCanvas for the specified gfx::AcceleratedWidget. 88 // Create SurfaceOzoneCanvas for the specified gfx::AcceleratedWidget.
89 // 89 //
90 // Note: The platform must support creation of SurfaceOzoneCanvas from the 90 // Note: The platform must support creation of SurfaceOzoneCanvas from the
91 // Browser Process using only the handle contained in gfx::AcceleratedWidget. 91 // Browser Process using only the handle contained in gfx::AcceleratedWidget.
92 virtual std::unique_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( 92 virtual std::unique_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget(
93 gfx::AcceleratedWidget widget); 93 gfx::AcceleratedWidget widget);
94 94
95 // Sets up GL bindings for the native surface. 95 // DEPRECATED(kylechar): Implement GLOzoneEGL instead.
96 virtual bool LoadEGLGLES2Bindings(); 96 virtual bool LoadEGLGLES2Bindings();
97 97
98 // Returns all scanout formats for |widget| representing a particular display 98 // Returns all scanout formats for |widget| representing a particular display
99 // controller or default display controller for kNullAcceleratedWidget. 99 // controller or default display controller for kNullAcceleratedWidget.
100 virtual std::vector<gfx::BufferFormat> GetScanoutFormats( 100 virtual std::vector<gfx::BufferFormat> GetScanoutFormats(
101 gfx::AcceleratedWidget widget); 101 gfx::AcceleratedWidget widget);
102 102
103 // Create a single native buffer to be used for overlay planes or zero copy 103 // Create a single native buffer to be used for overlay planes or zero copy
104 // for |widget| representing a particular display controller or default 104 // for |widget| representing a particular display controller or default
105 // display controller for kNullAcceleratedWidget. 105 // display controller for kNullAcceleratedWidget.
(...skipping 16 matching lines...) Expand all
122 SurfaceFactoryOzone(); 122 SurfaceFactoryOzone();
123 virtual ~SurfaceFactoryOzone(); 123 virtual ~SurfaceFactoryOzone();
124 124
125 private: 125 private:
126 DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryOzone); 126 DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryOzone);
127 }; 127 };
128 128
129 } // namespace ui 129 } // namespace ui
130 130
131 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ 131 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698