Implement screencopy damage
parent
ddaea0ceab
commit
e037e74756
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
10
src/main.c
10
src/main.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue