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_GL_SURFACE_WAYLAND_H_ |
| 6 #define UI_OZONE_PLATFORM_WAYLAND_GL_SURFACE_WAYLAND_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "ui/gfx/geometry/size.h" |
| 12 #include "ui/gl/gl_surface_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 std::unique_ptr<wl_egl_window, EGLWindowDeleter> CreateWaylandEglWindow( |
| 25 WaylandWindow* window); |
| 26 |
| 27 // GLSurface class implementation for wayland. |
| 28 class GLSurfaceWayland : public gl::NativeViewGLSurfaceEGL { |
| 29 public: |
| 30 using WaylandEglWindowPtr = std::unique_ptr<wl_egl_window, EGLWindowDeleter>; |
| 31 |
| 32 explicit GLSurfaceWayland(WaylandEglWindowPtr egl_window); |
| 33 |
| 34 // gl::GLSurface: |
| 35 bool Resize(const gfx::Size& size, |
| 36 float scale_factor, |
| 37 bool has_alpha) override; |
| 38 EGLConfig GetConfig() override; |
| 39 |
| 40 private: |
| 41 ~GLSurfaceWayland() override; |
| 42 |
| 43 WaylandEglWindowPtr egl_window_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(GLSurfaceWayland); |
| 46 }; |
| 47 |
| 48 } // namespace ui |
| 49 #endif // UI_OZONE_PLATFORM_WAYLAND_GL_SURFACE_WAYLAND_H_ |
OLD | NEW |