scene: apply rounding when translating buffer damage

Without a round in this case the damage region is translated to truncated coordinates, potentially
misplacing it relative to the actual position of that region in the output buffer.
This commit is contained in:
Ronan Pigott 2023-07-16 02:36:39 -07:00
parent 4de9c9c47f
commit b18c76642a

View file

@ -738,8 +738,8 @@ void wlr_scene_buffer_set_buffer_with_damage(struct wlr_scene_buffer *scene_buff
pixman_region32_fini(&cull_region); pixman_region32_fini(&cull_region);
pixman_region32_translate(&output_damage, pixman_region32_translate(&output_damage,
(lx - scene_output->x) * output_scale, (int)round((lx - scene_output->x) * output_scale),
(ly - scene_output->y) * output_scale); (int)round((ly - scene_output->y) * output_scale));
if (wlr_damage_ring_add(&scene_output->damage_ring, &output_damage)) { if (wlr_damage_ring_add(&scene_output->damage_ring, &output_damage)) {
wlr_output_schedule_frame(scene_output->output); wlr_output_schedule_frame(scene_output->output);
} }