Skip to content

Introduce wlr_buffer

Simon Ser requested to merge github/fork/emersion/wlr-buffer into master

This PR introduces wlr_buffer, as discussed in https://github.com/swaywm/wlroots/issues/1046#issuecomment-395679806.

wlr_buffers are ref-counted and hold a texture. When they are destroyed, the wl_buffer is released and the texture is destroyed.

A compositor can reference the buffer when it needs to:

struct wlr_buffer *buffer = wlr_buffer_ref(surface->buffer);

// Use buffer->texture (can be NULL if client destroys the buffer)

wlr_buffer_unref(buffer);

@ammen99 Can you provide some feedback? Would this approach work for you?

  • We probably want to get rid of wlr_surface.texture
  • Listen for renderer destroy

Fixes #1046 (closed)

Merge request reports