struct ds_output *ds_output;
struct ds_allocator *allocator;
struct ds_swapchain *swapchain;
- struct ds_buffer *front_buffer;
struct wl_listener output_destroy;
struct wl_listener output_frame;
output->server = server;
output->width = width;
output->height = height;
- output->front_buffer = NULL;
output->drawable = true;
output->damaged = true;
fini_output(struct tinyds_output *output)
{
wl_list_remove(&output->link);
- if (output->front_buffer)
- ds_buffer_unlock(output->front_buffer);
if (output->ds_output)
ds_output_destroy(output->ds_output);
ds_swapchain_destroy(output->swapchain);
output_image = pixman_image_from_buffer(output_buffer,
DS_BUFFER_DATA_PTR_ACCESS_WRITE);
- if (!output_image) {
- ds_buffer_unlock(output_buffer);
- return;
- }
+ if (!output_image)
+ goto out;
pixman_image_fill_color(output_image, 80, 80, 80);
ds_output_attach_buffer(output->ds_output, output_buffer);
ds_output_commit(output->ds_output);
- if (output->front_buffer)
- ds_buffer_unlock(output->front_buffer);
- output->front_buffer = output_buffer;
-
output->drawable = false;
output->damaged = false;
+
+out:
+ ds_buffer_unlock(output_buffer);
}
static void