diff options
author | Simon Ser <contact@emersion.fr> | 2021-04-12 11:49:57 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-04-19 18:09:13 +0200 |
commit | e8df7c367acad38ae7fd3ffcb7cbce1b6b3a3153 (patch) | |
tree | 1bd9ee5099b6e38d0f40ab7e1bb17cc5cbdc57f9 /include/wlr | |
parent | f64ed60c7b6caaea9a4331fb9481b151cd1631bb (diff) |
linux-dmabuf-v1: split params and buffer
Previously, the same struct was used for linux-dmabuf-v1 params
and buffer. This made the whole logic a little bit awkward, because
a wlr_dmabuf_v1_buffer could either be still being constructed, or
be a complete buffer.
Introduce a separate wlr_linux_buffer_params_v1 struct for buffer
params still being constructed. Once the params are complete (ie.
once the create request is sent), the params struct is destroyed
and the buffer struct is created.
This will help with [1] as well.
[1]: https://github.com/swaywm/wlroots/issues/2664
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/types/wlr_linux_dmabuf_v1.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/wlr/types/wlr_linux_dmabuf_v1.h b/include/wlr/types/wlr_linux_dmabuf_v1.h index 1d1a00eb..17e897c3 100644 --- a/include/wlr/types/wlr_linux_dmabuf_v1.h +++ b/include/wlr/types/wlr_linux_dmabuf_v1.h @@ -14,11 +14,8 @@ #include <wlr/render/dmabuf.h> struct wlr_dmabuf_v1_buffer { - struct wlr_renderer *renderer; - struct wl_resource *buffer_resource; - struct wl_resource *params_resource; + struct wl_resource *resource; struct wlr_dmabuf_attributes attributes; - bool has_modifier; }; /** @@ -34,6 +31,13 @@ bool wlr_dmabuf_v1_resource_is_buffer(struct wl_resource *buffer_resource); struct wlr_dmabuf_v1_buffer *wlr_dmabuf_v1_buffer_from_buffer_resource( struct wl_resource *buffer_resource); +struct wlr_linux_buffer_params_v1 { + struct wl_resource *resource; + struct wlr_linux_dmabuf_v1 *linux_dmabuf; + struct wlr_dmabuf_attributes attributes; + bool has_modifier; +}; + /* the protocol interface */ struct wlr_linux_dmabuf_v1 { struct wl_global *global; |