Hash :
007a4f06
Author :
Date :
2022-04-22T11:07:05
Vulkan: Wayland resize callback Handle client resize requests and resize the swapchain accordingly after next buffer swap. Bug: angleproject:6902 Change-Id: I8bd6b0d4efac041606f15eccb6befa28594905b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3608089 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jeff Vigil <j.vigil@samsung.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
//
// Copyright 2021-2022 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// WindowSurfaceVkWayland.h:
// Defines the class interface for WindowSurfaceVkWayland, implementing WindowSurfaceVk.
//
#ifndef LIBANGLE_RENDERER_VULKAN_WAYLAND_WINDOWSURFACEVKWAYLAND_H_
#define LIBANGLE_RENDERER_VULKAN_WAYLAND_WINDOWSURFACEVKWAYLAND_H_
#include "libANGLE/renderer/vulkan/SurfaceVk.h"
struct wl_display;
struct wl_egl_window;
namespace rx
{
class WindowSurfaceVkWayland : public WindowSurfaceVk
{
public:
// Requests of new sizes from client go through this callback, but actual resize will happen
// before the next operation which would provoke a backbuffer to be pulled.
static void ResizeCallback(wl_egl_window *window, void *payload);
WindowSurfaceVkWayland(const egl::SurfaceState &surfaceState,
EGLNativeWindowType window,
wl_display *display);
// On Wayland, currentExtent is undefined (0xFFFFFFFF, 0xFFFFFFFF).
// Whatever the application sets a swapchain's imageExtent to will be the size of the window,
// after the first image is presented
egl::Error getUserWidth(const egl::Display *display, EGLint *value) const override;
egl::Error getUserHeight(const egl::Display *display, EGLint *value) const override;
angle::Result getAttachmentRenderTarget(const gl::Context *context,
GLenum binding,
const gl::ImageIndex &imageIndex,
GLsizei samples,
FramebufferAttachmentRenderTarget **rtOut) override;
private:
angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) override;
angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) override;
wl_display *mWaylandDisplay;
gl::Extents mExtents;
bool mResized;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_VULKAN_WAYLAND_WINDOWSURFACEVKWAYLAND_H_