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_GFX_OZONE_SURFACE_OZONE_EGL_H_ | 5 #ifndef UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ |
6 #define UI_GFX_OZONE_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/gfx/gfx_export.h" | 10 #include "ui/ozone/ozone_base_export.h" |
11 | 11 |
12 namespace gfx { | 12 namespace gfx { |
13 | |
14 class Size; | 13 class Size; |
15 class VSyncProvider; | 14 class VSyncProvider; |
| 15 } |
| 16 |
| 17 namespace ui { |
16 | 18 |
17 // The platform-specific part of an EGL surface. | 19 // The platform-specific part of an EGL surface. |
18 // | 20 // |
19 // This class owns any bits that the ozone implementation needs freed when | 21 // This class owns any bits that the ozone implementation needs freed when |
20 // the EGL surface is destroyed. | 22 // the EGL surface is destroyed. |
21 class GFX_EXPORT SurfaceOzoneEGL { | 23 class OZONE_BASE_EXPORT SurfaceOzoneEGL { |
22 public: | 24 public: |
23 virtual ~SurfaceOzoneEGL() {} | 25 virtual ~SurfaceOzoneEGL() {} |
24 | 26 |
25 // Returns the EGL native window for rendering onto this surface. | 27 // Returns the EGL native window for rendering onto this surface. |
26 // This can be used to to create a GLSurface. | 28 // This can be used to to create a GLSurface. |
27 virtual intptr_t /* EGLNativeWindowType */ GetNativeWindow() = 0; | 29 virtual intptr_t /* EGLNativeWindowType */ GetNativeWindow() = 0; |
28 | 30 |
29 // Attempts to resize the EGL native window to match the viewport | 31 // Attempts to resize the EGL native window to match the viewport |
30 // size. | 32 // size. |
31 virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) = 0; | 33 virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) = 0; |
32 | 34 |
33 // Called after we swap buffers. This is usually a no-op but can | 35 // Called after we swap buffers. This is usually a no-op but can |
34 // be used to present the new front buffer if the platform requires this. | 36 // be used to present the new front buffer if the platform requires this. |
35 virtual bool OnSwapBuffers() = 0; | 37 virtual bool OnSwapBuffers() = 0; |
36 | 38 |
37 // Returns a gfx::VsyncProvider for this surface. Note that this may be | 39 // Returns a gfx::VsyncProvider for this surface. Note that this may be |
38 // called after we have entered the sandbox so if there are operations (e.g. | 40 // called after we have entered the sandbox so if there are operations (e.g. |
39 // opening a file descriptor providing vsync events) that must be done | 41 // opening a file descriptor providing vsync events) that must be done |
40 // outside of the sandbox, they must have been completed in | 42 // outside of the sandbox, they must have been completed in |
41 // InitializeHardware. Returns an empty scoped_ptr on error. | 43 // InitializeHardware. Returns an empty scoped_ptr on error. |
42 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() = 0; | 44 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() = 0; |
43 }; | 45 }; |
44 | 46 |
45 } // namespace gfx | 47 } // namespace ui |
46 | 48 |
47 #endif // UI_GFX_OZONE_SURFACE_OZONE_EGL_H_ | 49 #endif // UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ |
OLD | NEW |