aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Zeni <simon@bl4ckb0ne.ca>2021-07-06 20:20:14 -0400
committerSimon Ser <contact@emersion.fr>2021-07-09 23:16:39 +0200
commit60f4d8f4099e701ada2d7864c3bf4c76efb4434e (patch)
tree60cb18f0d53f2db9e45362c1562c79218e36bde9
parentd086501fba0aae84db09393ad720b57ae6f73f16 (diff)
types/wlr_buffer: remove wlr_resource_get_buffer_size
-rw-r--r--include/wlr/types/wlr_buffer.h5
-rw-r--r--types/wlr_buffer.c26
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) {