diff options
author | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-07-06 20:20:14 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-07-09 23:16:39 +0200 |
commit | 60f4d8f4099e701ada2d7864c3bf4c76efb4434e (patch) | |
tree | 60cb18f0d53f2db9e45362c1562c79218e36bde9 | |
parent | d086501fba0aae84db09393ad720b57ae6f73f16 (diff) |
types/wlr_buffer: remove wlr_resource_get_buffer_size
-rw-r--r-- | include/wlr/types/wlr_buffer.h | 5 | ||||
-rw-r--r-- | types/wlr_buffer.c | 26 |
2 files changed, 0 insertions, 31 deletions
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 @@ -157,11 +157,6 @@ struct wlr_client_buffer *wlr_client_buffer_get(struct wlr_buffer *buffer); */ 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 * returned. 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) { |