Lines Matching refs:image
137 struct wl_cursor_image image; member
157 struct cursor_image *image = (struct cursor_image *) _img; in wl_cursor_image_get_buffer() local
158 struct wl_cursor_theme *theme = image->theme; in wl_cursor_image_get_buffer()
160 if (!image->buffer) { in wl_cursor_image_get_buffer()
161 image->buffer = in wl_cursor_image_get_buffer()
163 image->offset, in wl_cursor_image_get_buffer()
169 return image->buffer; in wl_cursor_image_get_buffer()
175 struct cursor_image *image = (struct cursor_image *) _img; in wl_cursor_image_destroy() local
177 if (image->buffer) in wl_cursor_image_destroy()
178 wl_buffer_destroy(image->buffer); in wl_cursor_image_destroy()
180 free(image); in wl_cursor_image_destroy()
203 struct cursor_image *image; in wl_cursor_create_from_data() local
218 image = malloc(sizeof *image); in wl_cursor_create_from_data()
219 if (!image) in wl_cursor_create_from_data()
222 cursor->cursor.images[0] = (struct wl_cursor_image *) image; in wl_cursor_create_from_data()
223 image->theme = theme; in wl_cursor_create_from_data()
224 image->buffer = NULL; in wl_cursor_create_from_data()
225 image->image.width = metadata->width; in wl_cursor_create_from_data()
226 image->image.height = metadata->height; in wl_cursor_create_from_data()
227 image->image.hotspot_x = metadata->hotspot_x; in wl_cursor_create_from_data()
228 image->image.hotspot_y = metadata->hotspot_y; in wl_cursor_create_from_data()
229 image->image.delay = 0; in wl_cursor_create_from_data()
232 image->offset = shm_pool_allocate(theme->pool, size); in wl_cursor_create_from_data()
234 if (image->offset < 0) in wl_cursor_create_from_data()
237 memcpy(theme->pool->data + image->offset, in wl_cursor_create_from_data()
243 free(image); in wl_cursor_create_from_data()
285 struct cursor_image *image; in wl_cursor_create_from_xcursor_images() local
303 image = malloc(sizeof *image); in wl_cursor_create_from_xcursor_images()
304 if (image == NULL) in wl_cursor_create_from_xcursor_images()
307 image->theme = theme; in wl_cursor_create_from_xcursor_images()
308 image->buffer = NULL; in wl_cursor_create_from_xcursor_images()
310 image->image.width = images->images[i]->width; in wl_cursor_create_from_xcursor_images()
311 image->image.height = images->images[i]->height; in wl_cursor_create_from_xcursor_images()
312 image->image.hotspot_x = images->images[i]->xhot; in wl_cursor_create_from_xcursor_images()
313 image->image.hotspot_y = images->images[i]->yhot; in wl_cursor_create_from_xcursor_images()
314 image->image.delay = images->images[i]->delay; in wl_cursor_create_from_xcursor_images()
316 size = image->image.width * image->image.height * 4; in wl_cursor_create_from_xcursor_images()
317 image->offset = shm_pool_allocate(theme->pool, size); in wl_cursor_create_from_xcursor_images()
318 if (image->offset < 0) { in wl_cursor_create_from_xcursor_images()
319 free(image); in wl_cursor_create_from_xcursor_images()
324 memcpy(theme->pool->data + image->offset, in wl_cursor_create_from_xcursor_images()
326 cursor->total_delay += image->image.delay; in wl_cursor_create_from_xcursor_images()
327 cursor->cursor.images[i] = (struct wl_cursor_image *) image; in wl_cursor_create_from_xcursor_images()