libweston: Clip damage to paint node visible region

commit 79212ba9ad fixed a bug by
introducing a new one.

Before that point we could clip paint node damage to stale
visibility data. After that point we post damage for occluded
views, leading to large amounts of pointless drawing.

Add back the clip to visible region, in
weston_output_flush_damage_for_plane(), where we have up to date
visibility region information.

fixes 79212ba9ad

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
(cherry picked from commit e74f2897b9)
This commit is contained in:
Derek Foreman 2024-01-09 11:50:11 -06:00 committed by Marius Vlad
parent 17a9834892
commit cebcf8ff7c
1 changed files with 6 additions and 0 deletions

View File

@ -3378,6 +3378,12 @@ weston_output_flush_damage_for_plane(struct weston_output *output,
continue;
changed = true;
/* We can safely clip paint node damage to visible region
* here, as we're only dealing with nodes on this output,
* and the visibility regions for paint nodes on this
* output are up to date.
*/
pixman_region32_intersect(&pnode->damage, &pnode->damage, &pnode->visible);
pixman_region32_union(damage, damage, &pnode->damage);
pixman_region32_clear(&pnode->damage);
}