wlr_scene_set_buffer_with_damage: Only damage the visible parts of the node

This commit is contained in:
Alexander Orzechowski 2022-06-25 18:22:00 -04:00
parent c6246272fd
commit 6d62300324

View file

@ -577,6 +577,14 @@ void wlr_scene_buffer_set_buffer_with_damage(struct wlr_scene_buffer *scene_buff
pixman_region32_init(&output_damage);
wlr_region_scale_xy(&output_damage, &trans_damage,
output_scale * scale_x, output_scale * scale_y);
pixman_region32_t cull_region;
pixman_region32_init(&cull_region);
wlr_region_scale(&cull_region, &scene_buffer->node.visible, output_scale);
pixman_region32_translate(&cull_region, -lx * output_scale, -ly * output_scale);
pixman_region32_intersect(&output_damage, &output_damage, &cull_region);
pixman_region32_fini(&cull_region);
pixman_region32_translate(&output_damage,
(lx - scene_output->x) * output_scale,
(ly - scene_output->y) * output_scale);