OLD | NEW |
| (Empty) |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_EGL_SURFACE_H_ | |
6 #define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_EGL_SURFACE_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "ui/gfx/geometry/size.h" | |
11 #include "ui/gfx/vsync_provider.h" | |
12 #include "ui/ozone/public/surface_ozone_egl.h" | |
13 | |
14 struct wl_egl_window; | |
15 | |
16 namespace ui { | |
17 | |
18 class WaylandWindow; | |
19 | |
20 struct EGLWindowDeleter { | |
21 void operator()(wl_egl_window* egl_window); | |
22 }; | |
23 | |
24 class WaylandEGLSurface : public SurfaceOzoneEGL { | |
25 public: | |
26 WaylandEGLSurface(WaylandWindow* window, const gfx::Size& size); | |
27 ~WaylandEGLSurface() override; | |
28 | |
29 bool Initialize(); | |
30 | |
31 // SurfaceOzoneEGL | |
32 intptr_t GetNativeWindow() override; | |
33 bool ResizeNativeWindow(const gfx::Size& viewport_size) override; | |
34 bool OnSwapBuffers() override; | |
35 void OnSwapBuffersAsync(const SwapCompletionCallback& callback) override; | |
36 std::unique_ptr<gfx::VSyncProvider> CreateVSyncProvider() override; | |
37 void* /* EGLConfig */ GetEGLSurfaceConfig( | |
38 const EglConfigCallbacks& egl) override; | |
39 | |
40 private: | |
41 WaylandWindow* window_; | |
42 | |
43 gfx::Size size_; | |
44 std::unique_ptr<wl_egl_window, EGLWindowDeleter> egl_window_; | |
45 | |
46 DISALLOW_COPY_AND_ASSIGN(WaylandEGLSurface); | |
47 }; | |
48 | |
49 } // namespace ui | |
50 | |
51 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_EGL_SURFACE_H_ | |
OLD | NEW |