From ae5275c09fbd2cce326dee2b6d13fd8b9cdc08aa Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 25 Dec 2020 12:14:31 +0100 Subject: [PATCH] client-buffer: remove unnecessary wlr_resource_get_buffer_size We can just get the size from the imported texture. --- types/wlr_buffer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/types/wlr_buffer.c b/types/wlr_buffer.c index 29b26412..0878c302 100644 --- a/types/wlr_buffer.c +++ b/types/wlr_buffer.c @@ -222,9 +222,6 @@ struct wlr_client_buffer *wlr_client_buffer_import( return NULL; } - int width, height; - wlr_resource_get_buffer_size(resource, renderer, &width, &height); - struct wlr_client_buffer *buffer = calloc(1, sizeof(struct wlr_client_buffer)); if (buffer == NULL) { @@ -232,7 +229,8 @@ struct wlr_client_buffer *wlr_client_buffer_import( wl_resource_post_no_memory(resource); return NULL; } - wlr_buffer_init(&buffer->base, &client_buffer_impl, width, height); + wlr_buffer_init(&buffer->base, &client_buffer_impl, + texture->width, texture->height); buffer->resource = resource; buffer->texture = texture; buffer->resource_released = resource_released;