2
3
4
5
6
7
8
9
10
11
12
13
14
15
17#ifndef MIRAL_WAYLAND_SHM_H
18#define MIRAL_WAYLAND_SHM_H
20#include "mir/geometry/size.h"
22#include <wayland-client.h>
33 std::shared_ptr<WaylandShmPool> pool,
40 auto data()
const ->
void* {
return data_; }
44 auto is_in_use()
const ->
bool {
return self_ptr !=
nullptr; }
48 auto use() -> wl_buffer*;
53 static wl_buffer_listener
const buffer_listener;
55 static void handle_release(
void *data, wl_buffer*);
57 std::shared_ptr<WaylandShmPool>
const pool;
61 wl_buffer*
const buffer;
Definition: wayland_shm.h:30
auto use() -> wl_buffer *
Marks this buffer as in-use and assumes the resulting wl_buffer is sent to the compositor....
Definition: wayland_shm.cpp:135
auto data() const -> void *
Definition: wayland_shm.h:40
auto is_in_use() const -> bool
Returns if this buffer is currently being used by the compositor. In-use buffers keep themselves aliv...
Definition: wayland_shm.h:44
auto stride() const -> mir::geometry::Stride
Definition: wayland_shm.h:42
auto size() const -> mir::geometry::Size
Definition: wayland_shm.h:41
~WaylandShmBuffer()
Definition: wayland_shm.cpp:130
WaylandShmBuffer(std::shared_ptr< WaylandShmPool > pool, void *data, mir::geometry::Size size, mir::geometry::Stride stride, wl_buffer *buffer)
Definition: wayland_shm.cpp:115
A single WaylandShm does not efficiently provision multiple buffers for multiple window sizes....
Definition: wayland_shm.h:68
WaylandShm(wl_shm *shm)
Does not take ownership of the wl_shm.
Definition: wayland_shm.cpp:151
auto get_buffer(mir::geometry::Size size, mir::geometry::Stride stride) -> std::shared_ptr< WaylandShmBuffer >
Always returns a buffer of the correct size that is not in-use.
Definition: wayland_shm.cpp:156
Basic geometry types. Types for dimensions, displacements, etc. and the operations that they support.
Definition: size.h:27