Ream v0.1.0-1
C++ graphics library for Linux
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RVKSwapchainWL Class Referencefinal

Wayland-client Vulkan swapchain (VK_KHR_wayland_surface + VkSwapchainKHR). More...

#include <RVKSwapchainWL.h>

+ Inheritance diagram for RVKSwapchainWL:

Public Member Functions

std::optional< const RSwapchainImageacquire () noexcept override
 Acquire the next available swapchain image.
 
bool present (const RSwapchainImage &image, SkRegion *damage=nullptr) noexcept override
 Present a previously acquired image to the display.
 
bool resize (SkISize size) noexcept override
 Request a resize of future swapchain images.
 
- Public Member Functions inherited from RWLSwapchain
wl_surface * surface () const noexcept
 Returns the Wayland surface this swapchain presents to.
 
- Public Member Functions inherited from RSwapchain
 RSwapchain (SkISize size) noexcept
 Construct a swapchain with the given image size.
 
SkISize size () const noexcept
 The size of swapchain images in pixels.
 
- Public Member Functions inherited from RObject
 RObject ()=default
 Constructs a default RObject.
 

Additional Inherited Members

- Static Public Member Functions inherited from RWLSwapchain
static std::shared_ptr< RWLSwapchainMake (wl_surface *surface, SkISize size) noexcept
 Creates a Wayland swapchain for the given surface.
 

Detailed Description

Wayland-client Vulkan swapchain (VK_KHR_wayland_surface + VkSwapchainKHR).

Acquire blocks on a fence (the image must be ready before either the painter or Skia renders into it, and it doubles as frame pacing). Present is asynchronous: the PRESENT_SRC transition is submitted without a CPU wait, signalling a per-image semaphore that vkQueuePresentKHR waits on, so the CPU can run ahead into the next frame (one-frame-deep CPU/GPU pipelining).

Member Function Documentation

◆ acquire()

std::optional< const RSwapchainImage > acquire ( )
overridevirtualnoexcept

Acquire the next available swapchain image.

Returns
A new swapchain image on success, or nullopt on failure.

Implements RSwapchain.

◆ present()

bool present ( const RSwapchainImage image,
SkRegion *  damage = nullptr 
)
overridevirtualnoexcept

Present a previously acquired image to the display.

Parameters
imageThe image to be presented.
damageRegion of the image that has changed since the last frame.
  • Specified in buffer coordinates, relative to the top-left corner.
  • May extend beyond the image bounds.
  • Passing nullptr indicates full damage.
  • Passing an empty region indicates no damage.
Returns
true if the presentation succeeded, otherwise false.

Implements RSwapchain.

◆ resize()

bool resize ( SkISize  size)
overridevirtualnoexcept

Request a resize of future swapchain images.

This affects only newly acquired images, currently acquired images remain at the previous size until released.

Parameters
sizeThe new desired image size in pixels.
Returns
true if the resize request was accepted, otherwise false.

Implements RSwapchain.