|
|
|
@ -7,9 +7,11 @@
|
|
|
|
|
#include "util/signal.h"
|
|
|
|
|
|
|
|
|
|
void wlr_buffer_init(struct wlr_buffer *buffer,
|
|
|
|
|
const struct wlr_buffer_impl *impl) {
|
|
|
|
|
const struct wlr_buffer_impl *impl, int width, int height) {
|
|
|
|
|
assert(impl->destroy);
|
|
|
|
|
buffer->impl = impl;
|
|
|
|
|
buffer->width = width;
|
|
|
|
|
buffer->height = height;
|
|
|
|
|
wl_signal_init(&buffer->events.destroy);
|
|
|
|
|
wl_signal_init(&buffer->events.release);
|
|
|
|
|
}
|
|
|
|
@ -212,6 +214,9 @@ struct wlr_client_buffer *wlr_client_buffer_import(
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int width, height;
|
|
|
|
|
wlr_resource_get_buffer_size(resource, renderer, &width, &height);
|
|
|
|
|
|
|
|
|
|
struct wlr_client_buffer *buffer =
|
|
|
|
|
calloc(1, sizeof(struct wlr_client_buffer));
|
|
|
|
|
if (buffer == NULL) {
|
|
|
|
@ -219,7 +224,7 @@ struct wlr_client_buffer *wlr_client_buffer_import(
|
|
|
|
|
wl_resource_post_no_memory(resource);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
wlr_buffer_init(&buffer->base, &client_buffer_impl);
|
|
|
|
|
wlr_buffer_init(&buffer->base, &client_buffer_impl, width, height);
|
|
|
|
|
buffer->resource = resource;
|
|
|
|
|
buffer->texture = texture;
|
|
|
|
|
buffer->resource_released = resource_released;
|
|
|
|
|