Track damage on skipped frames

fix-damage-tracking
Andri Yngvason 2022-08-22 21:49:18 +00:00
parent 9ef4184e87
commit fc249a35a4
1 changed files with 12 additions and 10 deletions

View File

@ -559,14 +559,6 @@ static void render_from_vnc(void)
window->vnc->n_av_frames == 0) window->vnc->n_av_frames == 0)
return; return;
if (window->is_frame_committed)
return;
if (window->back_buffer->is_attached)
fprintf(stderr, "Oops, back-buffer is still attached.\n");
window_attach(window, 0, 0);
double scale; double scale;
int x_pos, y_pos; int x_pos, y_pos;
window_calculate_transform(window, &scale, &x_pos, &y_pos); window_calculate_transform(window, &scale, &x_pos, &y_pos);
@ -578,9 +570,16 @@ static void render_from_vnc(void)
pixman_region_fini(&damage_scaled); pixman_region_fini(&damage_scaled);
apply_buffer_damage(&damage); apply_buffer_damage(&damage);
window_damage_region(window, &damage);
pixman_region_fini(&damage); if (window->is_frame_committed)
goto done;
if (window->back_buffer->is_attached)
fprintf(stderr, "Oops, back-buffer is still attached.\n");
window_attach(window, 0, 0);
window_damage_region(window, &damage);
window_transfer_pixels(window); window_transfer_pixels(window);
@ -592,6 +591,9 @@ static void render_from_vnc(void)
pixman_region_clear(&window->current_damage); pixman_region_clear(&window->current_damage);
vnc_client_clear_av_frames(window->vnc); vnc_client_clear_av_frames(window->vnc);
done:
pixman_region_fini(&damage);
} }
void on_vnc_client_update_fb(struct vnc_client* client) void on_vnc_client_update_fb(struct vnc_client* client)