From d7c68ce6328be993b60b31522e1dbbeec5f55fb3 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 9 Jul 2021 17:06:56 +0200 Subject: buffer: stop using resource in client_buffer_get_dmabuf Instead, delegate to the source wlr_buffer. --- types/wlr_buffer.c | 13 ++----------- 1 file 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 = { -- cgit v1.2.3