|
|
@ -35,15 +35,12 @@ static const struct wl_region_interface region_impl = {
|
|
|
|
|
|
|
|
|
|
|
|
static void region_handle_resource_destroy(struct wl_resource *resource) {
|
|
|
|
static void region_handle_resource_destroy(struct wl_resource *resource) {
|
|
|
|
pixman_region32_t *reg = wlr_region_from_resource(resource);
|
|
|
|
pixman_region32_t *reg = wlr_region_from_resource(resource);
|
|
|
|
|
|
|
|
|
|
|
|
wl_list_remove(wl_resource_get_link(resource));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pixman_region32_fini(reg);
|
|
|
|
pixman_region32_fini(reg);
|
|
|
|
free(reg);
|
|
|
|
free(reg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct wl_resource *region_create(struct wl_client *client,
|
|
|
|
struct wl_resource *region_create(struct wl_client *client,
|
|
|
|
uint32_t version, uint32_t id, struct wl_list *resource_list) {
|
|
|
|
uint32_t version, uint32_t id) {
|
|
|
|
pixman_region32_t *region = calloc(1, sizeof(pixman_region32_t));
|
|
|
|
pixman_region32_t *region = calloc(1, sizeof(pixman_region32_t));
|
|
|
|
if (region == NULL) {
|
|
|
|
if (region == NULL) {
|
|
|
|
wl_client_post_no_memory(client);
|
|
|
|
wl_client_post_no_memory(client);
|
|
|
@ -62,13 +59,6 @@ struct wl_resource *region_create(struct wl_client *client,
|
|
|
|
wl_resource_set_implementation(region_resource, ®ion_impl, region,
|
|
|
|
wl_resource_set_implementation(region_resource, ®ion_impl, region,
|
|
|
|
region_handle_resource_destroy);
|
|
|
|
region_handle_resource_destroy);
|
|
|
|
|
|
|
|
|
|
|
|
struct wl_list *resource_link = wl_resource_get_link(region_resource);
|
|
|
|
|
|
|
|
if (resource_list != NULL) {
|
|
|
|
|
|
|
|
wl_list_insert(resource_list, resource_link);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
wl_list_init(resource_link);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return region_resource;
|
|
|
|
return region_resource;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|