diff --git a/include/wlr/types/wlr_buffer.h b/include/wlr/types/wlr_buffer.h index d0df0380..21bcdefc 100644 --- a/include/wlr/types/wlr_buffer.h +++ b/include/wlr/types/wlr_buffer.h @@ -156,11 +156,6 @@ struct wlr_client_buffer *wlr_client_buffer_get(struct wlr_buffer *buffer); * Check if a resource is a wl_buffer resource. */ bool wlr_resource_is_buffer(struct wl_resource *resource); -/** - * Get the size of a wl_buffer resource. - */ -bool wlr_resource_get_buffer_size(struct wl_resource *resource, - int *width, int *height); /** * Try to update the buffer's content. On success, returns the updated buffer * and destroys the provided `buffer`. On error, `buffer` is intact and NULL is diff --git a/types/wlr_buffer.c b/types/wlr_buffer.c index f0d488c7..d52b5b1b 100644 --- a/types/wlr_buffer.c +++ b/types/wlr_buffer.c @@ -104,32 +104,6 @@ bool wlr_resource_is_buffer(struct wl_resource *resource) { return strcmp(wl_resource_get_class(resource), wl_buffer_interface.name) == 0; } -bool wlr_resource_get_buffer_size(struct wl_resource *resource, - int *width, int *height) { - assert(wlr_resource_is_buffer(resource)); - - struct wl_shm_buffer *shm_buf = wl_shm_buffer_get(resource); - if (shm_buf != NULL) { - *width = wl_shm_buffer_get_width(shm_buf); - *height = wl_shm_buffer_get_height(shm_buf); - } else if (wlr_dmabuf_v1_resource_is_buffer(resource)) { - struct wlr_dmabuf_v1_buffer *dmabuf = - wlr_dmabuf_v1_buffer_from_buffer_resource(resource); - *width = dmabuf->attributes.width; - *height = dmabuf->attributes.height; - } else if (wlr_drm_buffer_is_resource(resource)) { - struct wlr_drm_buffer *drm_buffer = - wlr_drm_buffer_from_resource(resource); - *width = drm_buffer->base.width; - *height = drm_buffer->base.height; - } else { - *width = *height = 0; - return false; - } - - return true; -} - static const struct wlr_buffer_impl client_buffer_impl; struct wlr_client_buffer *wlr_client_buffer_get(struct wlr_buffer *buffer) {