All public resource creators now take a new ID for the resource
and an optional list where the resource link is added. When the
resource is destroyed it is its own responsibility to remove
itself from the list. This removes the need for the caller to add
a destroy listener.
This commit fixes a few segfaults with resources not removed from
the list when destroyed.
When a client attaches a wl_drm or a linux_dmabuf buffer, we only
update it if the size is different from the one of the old buffer.
This means that if the client attaches a new, updated buffer with
the same size as the old buffer, the texture won't get updated.
This commit changes this behavior and re-creates the texture if
the client attaches a new buffer, without requiring the size to be
different.
- Textures are now immutable (apart from those created from raw
pixels), no more invalid textures
- Move all wl_drm stuff in wlr_renderer
- Most of wlr_texture fields are now private
- Remove some duplicated DMA-BUF code in the DRM backend
- Add more assertions
- Stride is now always given as bytes rather than pixels
- Drop wl_shm functions
Fun fact: this patch has been written 10,000 meters up in the air.
Tested with
./weston-simple-dmabuf-drm
./weston-simple-dmabuf-drm --import-immediate=1
./weston-simple-dmabuf-drm --y-inverted=1
(and combinations)
Supports only single plane XRGB dmabufs for now.
A similar change should probably be applied to hardware cursors, though
more complicated. Also, this doesn't actually fix the issue where the
cursor is too small when over a scale=2 surface. Apparently they don't
set their cursor scales to 2. Seems like a client bug? idk