Implement screencopy damage

shader-damage
Andri Yngvason 2019-10-10 21:40:22 +00:00
parent ddaea0ceab
commit e037e74756
3 changed files with 20 additions and 4 deletions

View File

@ -36,6 +36,13 @@ struct screencopy {
uint32_t height;
uint32_t stride;
struct {
uint32_t x;
uint32_t y;
uint32_t width;
uint32_t height;
} damage;
void* userdata;
};

View File

@ -388,8 +388,14 @@ void wayvnc_update_vnc(struct wayvnc* self, struct nvnc_fb* fb)
self->current_fb = fb;
if (self->last_fb) {
nvnc_check_damage(self->current_fb, self->last_fb, 0, 0,
width, height, on_damage_check_done, self);
uint32_t hint_x = self->screencopy_backend.damage.x;
uint32_t hint_y = self->screencopy_backend.damage.y;
uint32_t hint_width = self->screencopy_backend.damage.width;
uint32_t hint_height = self->screencopy_backend.damage.height;
nvnc_check_damage(self->current_fb, self->last_fb, hint_x,
hint_y, hint_width, hint_height,
on_damage_check_done, self);
return;
}

View File

@ -92,7 +92,7 @@ static void screencopy_buffer(void* data,
self->height = height;
self->stride = stride;
zwlr_screencopy_frame_v1_copy(self->frame, self->buffer);
zwlr_screencopy_frame_v1_copy_with_damage(self->frame, self->buffer);
}
static void screencopy_flags(void* data,
@ -136,7 +136,10 @@ static void screencopy_damage(void* data,
{
struct screencopy* self = data;
/* TODO */
self->damage.x = x;
self->damage.y = y;
self->damage.width = width;
self->damage.height = height;
}
int screencopy_start(struct screencopy* self)