OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_OZONE_EGL_H_ | 5 #ifndef UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ |
6 #define UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ | 6 #define UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/ozone/ozone_base_export.h" | 10 #include "ui/ozone/ozone_base_export.h" |
11 | 11 |
12 namespace gfx { | 12 namespace gfx { |
13 class Size; | 13 class Size; |
14 class VSyncProvider; | 14 class VSyncProvider; |
15 } | 15 } |
16 | 16 |
17 namespace ui { | 17 namespace ui { |
| 18 class NativePixmap; |
18 | 19 |
19 // The platform-specific part of an EGL surface. | 20 // The platform-specific part of an EGL surface. |
20 // | 21 // |
21 // This class owns any bits that the ozone implementation needs freed when | 22 // This class owns any bits that the ozone implementation needs freed when |
22 // the EGL surface is destroyed. | 23 // the EGL surface is destroyed. |
23 class OZONE_BASE_EXPORT SurfaceOzoneEGL { | 24 class OZONE_BASE_EXPORT SurfaceOzoneEGL { |
24 public: | 25 public: |
25 virtual ~SurfaceOzoneEGL() {} | 26 virtual ~SurfaceOzoneEGL() {} |
26 | 27 |
27 // Returns the EGL native window for rendering onto this surface. | 28 // Returns the EGL native window for rendering onto this surface. |
28 // This can be used to to create a GLSurface. | 29 // This can be used to to create a GLSurface. |
29 virtual intptr_t /* EGLNativeWindowType */ GetNativeWindow() = 0; | 30 virtual intptr_t /* EGLNativeWindowType */ GetNativeWindow() = 0; |
30 | 31 |
31 // Attempts to resize the EGL native window to match the viewport | 32 // Attempts to resize the EGL native window to match the viewport |
32 // size. | 33 // size. |
33 virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) = 0; | 34 virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) = 0; |
34 | 35 |
35 // Called after we swap buffers. This is usually a no-op but can | 36 // Called after we swap buffers. This is usually a no-op but can |
36 // be used to present the new front buffer if the platform requires this. | 37 // be used to present the new front buffer if the platform requires this. |
37 virtual bool OnSwapBuffers() = 0; | 38 virtual bool OnSwapBuffers() = 0; |
38 | 39 |
39 // Returns a gfx::VsyncProvider for this surface. Note that this may be | 40 // Returns a gfx::VsyncProvider for this surface. Note that this may be |
40 // called after we have entered the sandbox so if there are operations (e.g. | 41 // called after we have entered the sandbox so if there are operations (e.g. |
41 // opening a file descriptor providing vsync events) that must be done | 42 // opening a file descriptor providing vsync events) that must be done |
42 // outside of the sandbox, they must have been completed in | 43 // outside of the sandbox, they must have been completed in |
43 // InitializeHardware. Returns an empty scoped_ptr on error. | 44 // InitializeHardware. Returns an empty scoped_ptr on error. |
44 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() = 0; | 45 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() = 0; |
| 46 |
| 47 // Sets the overlay plane to switch to at the next page flip. |
| 48 // |plane_z_order| specifies the stacking order of the plane relative to the |
| 49 // main framebuffer located at index 0. |
| 50 // |plane_transform| specifies how the buffer is to be transformed during. |
| 51 // composition. |
| 52 // |buffer| to be presented by the overlay. |
| 53 // |display_bounds| specify where it is supposed to be on the screen. |
| 54 // |crop_rect| specifies the region within the buffer to be placed inside |
| 55 // |display_bounds|. |
| 56 virtual bool ScheduleOverlayPlane(int plane_z_order, |
| 57 gfx::OverlayTransform plane_transform, |
| 58 scoped_refptr<NativePixmap> buffer, |
| 59 const gfx::Rect& display_bounds, |
| 60 const gfx::RectF& crop_rect) = 0; |
45 }; | 61 }; |
46 | 62 |
47 } // namespace ui | 63 } // namespace ui |
48 | 64 |
49 #endif // UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ | 65 #endif // UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ |
OLD | NEW |