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 "ui/gfx/geometry/size.h" |
| 9 #include "ui/gfx/vsync_provider.h" |
| 10 #include "ui/ozone/public/surface_ozone_egl.h" |
| 11 |
| 12 struct wl_egl_window; |
| 13 |
| 14 namespace ui { |
| 15 |
| 16 class WaylandWindow; |
| 17 |
| 18 struct EGLWindowDeleter { |
| 19 void operator()(wl_egl_window* egl_window); |
| 20 }; |
| 21 |
| 22 class WaylandEGLSurface : public SurfaceOzoneEGL { |
| 23 public: |
| 24 WaylandEGLSurface(WaylandWindow* window, const gfx::Size& size); |
| 25 ~WaylandEGLSurface() override; |
| 26 |
| 27 bool Initialize(); |
| 28 |
| 29 // SurfaceOzoneEGL |
| 30 intptr_t GetNativeWindow() override; |
| 31 bool ResizeNativeWindow(const gfx::Size& viewport_size) override; |
| 32 bool OnSwapBuffers() override; |
| 33 void OnSwapBuffersAsync(const SwapCompletionCallback& callback) override; |
| 34 scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() override; |
| 35 void* /* EGLConfig */ GetEGLSurfaceConfig( |
| 36 const EglConfigCallbacks& egl) override; |
| 37 |
| 38 private: |
| 39 WaylandWindow* window_; |
| 40 |
| 41 gfx::Size size_; |
| 42 scoped_ptr<wl_egl_window, EGLWindowDeleter> egl_window_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(WaylandEGLSurface); |
| 45 }; |
| 46 |
| 47 } // namespace ui |
| 48 |
| 49 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_EGL_SURFACE_H_ |
OLD | NEW |