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/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "ui/gfx/overlay_transform.h" | 11 #include "ui/gfx/overlay_transform.h" |
12 #include "ui/gfx/swap_result.h" | |
12 #include "ui/ozone/ozone_base_export.h" | 13 #include "ui/ozone/ozone_base_export.h" |
13 | 14 |
14 namespace gfx { | 15 namespace gfx { |
15 class Size; | 16 class Size; |
16 class VSyncProvider; | 17 class VSyncProvider; |
17 } | 18 } |
18 | 19 |
19 namespace ui { | 20 namespace ui { |
20 class NativePixmap; | 21 class NativePixmap; |
21 | 22 |
(...skipping 10 matching lines...) Expand all Loading... | |
32 virtual intptr_t /* EGLNativeWindowType */ GetNativeWindow() = 0; | 33 virtual intptr_t /* EGLNativeWindowType */ GetNativeWindow() = 0; |
33 | 34 |
34 // Attempts to resize the EGL native window to match the viewport | 35 // Attempts to resize the EGL native window to match the viewport |
35 // size. | 36 // size. |
36 virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) = 0; | 37 virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) = 0; |
37 | 38 |
38 // Called after we swap buffers. This is usually a no-op but can | 39 // Called after we swap buffers. This is usually a no-op but can |
39 // be used to present the new front buffer if the platform requires this. | 40 // be used to present the new front buffer if the platform requires this. |
40 virtual bool OnSwapBuffers() = 0; | 41 virtual bool OnSwapBuffers() = 0; |
41 | 42 |
42 typedef base::Closure SwapCompletionCallback; | 43 typedef base::Callback<void(gfx::SwapResult)> SwapCompletionCallback; |
dnicoara
2015/05/08 15:15:41
typedefs should be declared first in the class.
achaulk
2015/05/14 18:15:46
Done.
| |
43 // Called after we swap buffers. This is usually a no-op but can | 44 // Called after we swap buffers. This is usually a no-op but can |
44 // be used to present the new front buffer if the platform requires this. | 45 // be used to present the new front buffer if the platform requires this. |
45 // The callback should be run on the calling thread | 46 // The callback should be run on the calling thread |
46 // (i.e. same thread SwapBuffersAsync is called). | 47 // (i.e. same thread SwapBuffersAsync is called). |
47 virtual bool OnSwapBuffersAsync(const SwapCompletionCallback& callback) = 0; | 48 virtual bool OnSwapBuffersAsync(const SwapCompletionCallback& callback) = 0; |
48 | 49 |
49 // Returns a gfx::VsyncProvider for this surface. Note that this may be | 50 // Returns a gfx::VsyncProvider for this surface. Note that this may be |
50 // called after we have entered the sandbox so if there are operations (e.g. | 51 // called after we have entered the sandbox so if there are operations (e.g. |
51 // opening a file descriptor providing vsync events) that must be done | 52 // opening a file descriptor providing vsync events) that must be done |
52 // outside of the sandbox, they must have been completed in | 53 // outside of the sandbox, they must have been completed in |
53 // InitializeHardware. Returns an empty scoped_ptr on error. | 54 // InitializeHardware. Returns an empty scoped_ptr on error. |
54 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() = 0; | 55 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() = 0; |
55 | 56 |
56 // Returns true if the surface is created on a UDL device. | 57 // Returns true if the surface is created on a UDL device. |
57 virtual bool IsUniversalDisplayLinkDevice(); | 58 virtual bool IsUniversalDisplayLinkDevice(); |
58 }; | 59 }; |
59 | 60 |
60 } // namespace ui | 61 } // namespace ui |
61 | 62 |
62 #endif // UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ | 63 #endif // UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ |
OLD | NEW |