de685b8843f9070507ccca631d08cb5fff93e622
The wl_buffer reference counting API has been inconsistent. You would manually increment the refcount and register a destroy listener, as opposed to calling weston_buffer_post_release(), which internally decremented the refcount, and then removing a list item. Replace both cases with a single function: weston_buffer_reference(weston_buffer_reference *ref, wl_buffer *buffer) Buffer is assigned to ref->buffer, while taking care of all the refcounting and release posting. You take a reference by passing a non-NULL buffer, and release a reference by passing NULL as buffer. The function uses an internal wl_buffer destroy listener, so the pointer gets reset on destruction automatically. This is inspired by the pipe_resource_reference() of Mesa, and modified by krh's suggestion to add struct weston_buffer_reference. Additionally, when a surface gets destroyed, the associated wl_buffer will send a release event. Often the buffer is already destroyed on client side, so the event will be discarded by libwayland-client. Compositor-drm.c is converted to use weston_buffer_reference. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Weston Weston is the reference implementation of a Wayland compositor, and a useful compositor in its own right. Weston has various backends that lets it run on Linux kernel modesetting and evdev input as well as under X11. Weston ships with a few example clients, from simple clients that demonstrate certain aspects of the protocol to more complete clients and a simplistic toolkit. There is also a quite capable terminal emulator (weston-terminal) and an toy/example desktop shell. Finally, weston also provides integration with the Xorg server and can pull X clients into the Wayland desktop and act as a X window manager. Refer to http://wayland.freedesktop.org/building.html for buiding weston and its dependencies.
Description
Languages
C
98%
Meson
1.4%
Shell
0.3%
GLSL
0.2%