From 2fcebfed95447b994649f58f7b0d40e8bac8de08 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Mon, 9 May 2011 17:35:58 +0200 Subject: [PATCH 1/3] Add buffer.release event --- protocol/wayland.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index ad350723..3dc3c0b8 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -139,6 +139,9 @@ + + + From a56c0455717c4772e8e4b78e56af439ccd2356af Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 10 May 2011 12:01:00 +0200 Subject: [PATCH 2/3] Add busy_count and client parameter to wl_buffer Can be used to implement release event. --- wayland/wayland-server.h | 2 ++ wayland/wayland-shm.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wayland/wayland-server.h b/wayland/wayland-server.h index 6a042cd8..62c45823 100644 --- a/wayland/wayland-server.h +++ b/wayland/wayland-server.h @@ -132,8 +132,10 @@ struct wl_resource { struct wl_buffer { struct wl_resource resource; struct wl_compositor *compositor; + struct wl_client *client; struct wl_visual *visual; int32_t width, height; + uint32_t busy_count; void *user_data; }; diff --git a/wayland/wayland-shm.c b/wayland/wayland-shm.c index cdd78745..90d2fcfb 100644 --- a/wayland/wayland-shm.c +++ b/wayland/wayland-shm.c @@ -80,20 +80,21 @@ const static struct wl_buffer_interface shm_buffer_interface = { }; static struct wl_shm_buffer * -wl_shm_buffer_init(struct wl_shm *shm, uint32_t id, +wl_shm_buffer_init(struct wl_shm *shm, struct wl_client *client, uint32_t id, int32_t width, int32_t height, int32_t stride, struct wl_visual *visual, void *data) { struct wl_shm_buffer *buffer; - buffer = malloc(sizeof *buffer); + buffer = calloc(1, sizeof *buffer); if (buffer == NULL) return NULL; buffer->buffer.width = width; buffer->buffer.height = height; buffer->buffer.visual = visual; + buffer->buffer.client = client; buffer->stride = stride; buffer->data = data; @@ -147,7 +148,7 @@ shm_create_buffer(struct wl_client *client, struct wl_shm *shm, return; } - buffer = wl_shm_buffer_init(shm, id, + buffer = wl_shm_buffer_init(shm, client, id, width, height, stride, visual, data); if (buffer == NULL) { From 4c2500c2e2abc380f34e3222d31222fd103015a5 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 21 Jun 2011 17:37:18 +0200 Subject: [PATCH 3/3] Drop wl_compoositor parameter in wl_buffer --- wayland/wayland-server.h | 1 - 1 file changed, 1 deletion(-) diff --git a/wayland/wayland-server.h b/wayland/wayland-server.h index 62c45823..7cd8e1ef 100644 --- a/wayland/wayland-server.h +++ b/wayland/wayland-server.h @@ -131,7 +131,6 @@ struct wl_resource { struct wl_buffer { struct wl_resource resource; - struct wl_compositor *compositor; struct wl_client *client; struct wl_visual *visual; int32_t width, height;