19 #ifndef MIRAL_WAYLAND_SHM_H
20 #define MIRAL_WAYLAND_SHM_H
24 #include <wayland-client.h>
30 struct wl_shm_pool*
make_shm_pool(
struct wl_shm* shm,
int size,
void **data);
38 auto data() const ->
void* {
return data_; }
39 operator wl_buffer*()
const {
return buffer; }
44 auto is_in_use() const ->
bool {
return self_ptr !=
nullptr; }
46 static wl_buffer_listener
const buffer_listener;
48 static void handle_release(
void *
data, wl_buffer*);
51 size_t const data_size;
52 wl_buffer*
const buffer;
53 std::shared_ptr<WaylandShmBuffer> self_ptr;
67 std::shared_ptr<WaylandShmBuffer> current_buffer;
Definition: wayland_shm.h:33
auto data() const -> void *
Definition: wayland_shm.h:38
WaylandShmBuffer(void *data, size_t data_size, wl_buffer *buffer)
Definition: wayland_shm.cpp:90
~WaylandShmBuffer()
Definition: wayland_shm.cpp:98
Definition: wayland_shm.h:57
WaylandShm(wl_shm *shm)
Does not take ownership of the wl_shm.
Definition: wayland_shm.cpp:110
auto get_buffer(mir::geometry::Size size, mir::geometry::Stride stride) -> WaylandShmBuffer *
The returned buffer is automatically released as long as it is sent to the compositor.
Definition: wayland_shm.cpp:115
Definition: dimensions.h:37
struct wl_shm_pool * make_shm_pool(struct wl_shm *shm, int size, void **data)
Definition: wayland_shm.cpp:30