aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-07-09 17:06:56 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-07-09 17:25:02 -0400
commitd7c68ce6328be993b60b31522e1dbbeec5f55fb3 (patch)
tree88af48ac10eb375b9a3949f72c79aa8882a5b199
parenta0baba4fa0fc391aaf896618fe882fd321a1cbb7 (diff)
buffer: stop using resource in client_buffer_get_dmabuf
Instead, delegate to the source wlr_buffer.
-rw-r--r--types/wlr_buffer.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/types/wlr_buffer.c b/types/wlr_buffer.c
index ba02f384..a81f39bd 100644
--- a/types/wlr_buffer.c
+++ b/types/wlr_buffer.c
@@ -133,20 +133,11 @@ static bool client_buffer_get_dmabuf(struct wlr_buffer *buffer,
struct wlr_dmabuf_attributes *attribs) {
struct wlr_client_buffer *client_buffer = client_buffer_from_buffer(buffer);
- if (client_buffer->resource == NULL) {
+ if (client_buffer->source == NULL) {
return false;
}
- struct wl_resource *buffer_resource = client_buffer->resource;
- if (!wlr_dmabuf_v1_resource_is_buffer(buffer_resource)) {
- return false;
- }
-
- struct wlr_dmabuf_v1_buffer *dmabuf_buffer =
- wlr_dmabuf_v1_buffer_from_buffer_resource(buffer_resource);
- memcpy(attribs, &dmabuf_buffer->attributes,
- sizeof(struct wlr_dmabuf_attributes));
- return true;
+ return wlr_buffer_get_dmabuf(client_buffer->source, attribs);
}
static const struct wlr_buffer_impl client_buffer_impl = {