mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-01 22:58:40 -04:00
Add busy_count and client parameter to wl_buffer
Can be used to implement release event.
This commit is contained in:
parent
2fcebfed95
commit
a56c045571
2 changed files with 6 additions and 3 deletions
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue