1 // 2 // Copyright 2021-2022 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 // WindowSurfaceVkWayland.h: 7 // Defines the class interface for WindowSurfaceVkWayland, implementing WindowSurfaceVk. 8 // 9 10 #ifndef LIBANGLE_RENDERER_VULKAN_WAYLAND_WINDOWSURFACEVKWAYLAND_H_ 11 #define LIBANGLE_RENDERER_VULKAN_WAYLAND_WINDOWSURFACEVKWAYLAND_H_ 12 13 #include "libANGLE/renderer/vulkan/SurfaceVk.h" 14 15 struct wl_display; 16 struct wl_egl_window; 17 18 namespace rx 19 { 20 21 class WindowSurfaceVkWayland : public WindowSurfaceVk 22 { 23 public: 24 // Requests of new sizes from client go through this callback, but actual resize will happen 25 // before the next operation which would provoke a backbuffer to be pulled. 26 static void ResizeCallback(wl_egl_window *window, void *payload); 27 28 WindowSurfaceVkWayland(const egl::SurfaceState &surfaceState, 29 EGLNativeWindowType window, 30 wl_display *display); 31 32 private: 33 angle::Result createSurfaceVk(vk::ErrorContext *context) override; 34 angle::Result getCurrentWindowSize(vk::ErrorContext *context, 35 gl::Extents *extentsOut) const override; 36 37 wl_display *mWaylandDisplay; 38 gl::Extents mExtents; 39 }; 40 41 } // namespace rx 42 43 #endif // LIBANGLE_RENDERER_VULKAN_WAYLAND_WINDOWSURFACEVKWAYLAND_H_ 44