Class WaylandShmBuffer

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< WaylandShmBuffer >

Class Documentation

class WaylandShmBuffer : public std::enable_shared_from_this<WaylandShmBuffer>

Public Functions

WaylandShmBuffer(std::shared_ptr<WaylandShmPool> pool, void *data, mir::geometry::Size size, mir::geometry::Stride stride, wl_buffer *buffer)
inline auto data() const -> void*
inline auto size() const -> mir::geometry::Size
inline auto stride() const -> mir::geometry::Stride
inline auto is_in_use() const -> bool

Returns if this buffer is currently being used by the compositor. In-use buffers keep themselves alive.

auto use() -> wl_buffer*

Marks this buffer as in-use and assumes the resulting wl_buffer is sent to the compositor. Keeps this buffer alive until the compositor releases it (if it’s not sent to the compositor or the compositor never releases it this buffer is leaked). Should only be called if the buffer is not already in-use.