OLD | NEW |
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_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ | 5 #ifndef UI_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ |
6 #define UI_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ | 6 #define UI_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/native_library.h" | 10 #include "base/native_library.h" |
11 #include "ui/gfx/geometry/point.h" | 11 #include "ui/gfx/geometry/point.h" |
12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
13 #include "ui/gfx/gfx_export.h" | 13 #include "ui/gfx/gfx_export.h" |
14 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
16 | 16 |
17 class SkBitmap; | 17 class SkBitmap; |
18 class SkCanvas; | 18 class SkCanvas; |
19 | 19 |
20 namespace gfx { | 20 namespace gfx { |
21 class VSyncProvider; | 21 class VSyncProvider; |
22 class OverlayCandidatesOzone; | 22 class OverlayCandidatesOzone; |
23 class SurfaceOzone; | 23 class SurfaceOzone; |
24 typedef intptr_t NativeBufferOzone; | 24 typedef intptr_t NativeBufferOzone; |
25 | 25 |
| 26 // Widget for use by platforms that only support one surface at a time. |
| 27 // This is probably not useful for any real platform, but it makes |
| 28 // implementing simple platforms with only one surface easier. |
| 29 GFX_EXPORT extern const gfx::AcceleratedWidget |
| 30 kDefaultAcceleratedWidgetForSingleWindow; |
| 31 |
26 // The Ozone interface allows external implementations to hook into Chromium to | 32 // The Ozone interface allows external implementations to hook into Chromium to |
27 // provide a system specific implementation. The Ozone interface supports two | 33 // provide a system specific implementation. The Ozone interface supports two |
28 // drawing modes: 1) accelerated drawing through EGL and 2) software drawing | 34 // drawing modes: 1) accelerated drawing through EGL and 2) software drawing |
29 // through Skia. | 35 // through Skia. |
30 // | 36 // |
31 // The following functionality is specific to the drawing mode and may not have | 37 // The following functionality is specific to the drawing mode and may not have |
32 // any meaningful implementation in the other mode. An implementation must | 38 // any meaningful implementation in the other mode. An implementation must |
33 // provide functionality for at least one mode. | 39 // provide functionality for at least one mode. |
34 // | 40 // |
35 // 1) Accelerated Drawing (EGL path): | 41 // 1) Accelerated Drawing (EGL path): |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 virtual HardwareState InitializeHardware() = 0; | 104 virtual HardwareState InitializeHardware() = 0; |
99 | 105 |
100 // Cleans up display hardware state. Call this from within the GPU process. | 106 // Cleans up display hardware state. Call this from within the GPU process. |
101 // This method must be safe to run inside of the sandbox. | 107 // This method must be safe to run inside of the sandbox. |
102 virtual void ShutdownHardware() = 0; | 108 virtual void ShutdownHardware() = 0; |
103 | 109 |
104 // Returns native platform display handle. This is used to obtain the EGL | 110 // Returns native platform display handle. This is used to obtain the EGL |
105 // display connection for the native display. | 111 // display connection for the native display. |
106 virtual intptr_t GetNativeDisplay(); | 112 virtual intptr_t GetNativeDisplay(); |
107 | 113 |
108 // Obtains an AcceleratedWidget backed by a native Linux framebuffer. | |
109 // The returned AcceleratedWidget is an opaque token that must realized | |
110 // before it can be used to create a GL surface. | |
111 virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0; | |
112 | |
113 // Create a surface for the specified gfx::AcceleratedWidget. | 114 // Create a surface for the specified gfx::AcceleratedWidget. |
114 virtual scoped_ptr<SurfaceOzone> CreateSurfaceForWidget( | 115 virtual scoped_ptr<SurfaceOzone> CreateSurfaceForWidget( |
115 gfx::AcceleratedWidget widget); | 116 gfx::AcceleratedWidget widget); |
116 | 117 |
117 // Sets up GL bindings for the native surface. Takes two callback parameters | 118 // Sets up GL bindings for the native surface. Takes two callback parameters |
118 // that allow Ozone to register the GL bindings. | 119 // that allow Ozone to register the GL bindings. |
119 virtual bool LoadEGLGLES2Bindings( | 120 virtual bool LoadEGLGLES2Bindings( |
120 AddGLLibraryCallback add_gl_library, | 121 AddGLLibraryCallback add_gl_library, |
121 SetGLGetProcAddressProcCallback set_gl_get_proc_address) = 0; | 122 SetGLGetProcAddressProcCallback set_gl_get_proc_address) = 0; |
122 | 123 |
(...skipping 28 matching lines...) Expand all Loading... |
151 virtual gfx::NativeBufferOzone CreateNativeBuffer(gfx::Size size, | 152 virtual gfx::NativeBufferOzone CreateNativeBuffer(gfx::Size size, |
152 BufferFormat format); | 153 BufferFormat format); |
153 | 154 |
154 private: | 155 private: |
155 static SurfaceFactoryOzone* impl_; // not owned | 156 static SurfaceFactoryOzone* impl_; // not owned |
156 }; | 157 }; |
157 | 158 |
158 } // namespace gfx | 159 } // namespace gfx |
159 | 160 |
160 #endif // UI_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ | 161 #endif // UI_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ |
OLD | NEW |