summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-07-20 12:04:42 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-07-20 12:04:42 -0400
commit7ba218c9f80c9ce6f1a54e4e1b2f8aa66c590ade (patch)
tree3e295bb24bb72026ae1ced6a907168003a089bc9 /src
parent0a9cd16f6a6819392777e7b50601bb7e39b019da (diff)
shm: Add shm_buffer getters for width and height
Diffstat (limited to 'src')
-rw-r--r--src/wayland-server.h6
-rw-r--r--src/wayland-shm.c16
2 files changed, 22 insertions, 0 deletions
diff --git a/src/wayland-server.h b/src/wayland-server.h
index 18a8beb..f092145 100644
--- a/src/wayland-server.h
+++ b/src/wayland-server.h
@@ -428,6 +428,12 @@ wl_shm_buffer_get_stride(struct wl_buffer *buffer);
uint32_t
wl_shm_buffer_get_format(struct wl_buffer *buffer);
+int32_t
+wl_shm_buffer_get_width(struct wl_buffer *buffer);
+
+int32_t
+wl_shm_buffer_get_height(struct wl_buffer *buffer);
+
int
wl_buffer_is_shm(struct wl_buffer *buffer);
diff --git a/src/wayland-shm.c b/src/wayland-shm.c
index 2edaff4..50e4297 100644
--- a/src/wayland-shm.c
+++ b/src/wayland-shm.c
@@ -291,3 +291,19 @@ wl_shm_buffer_get_format(struct wl_buffer *buffer_base)
return buffer->format;
}
+
+WL_EXPORT uint32_t
+wl_shm_buffer_get_width(struct wl_buffer *buffer_base)
+{
+ struct wl_shm_buffer *buffer = (struct wl_shm_buffer *) buffer_base;
+
+ return buffer->base.width;
+}
+
+WL_EXPORT uint32_t
+wl_shm_buffer_get_height(struct wl_buffer *buffer_base)
+{
+ struct wl_shm_buffer *buffer = (struct wl_shm_buffer *) buffer_base;
+
+ return buffer->base.height;
+}