paint_node: Fix paint_node_damage_below

This list walk is broken, the intent was to walk the tail of the list
starting from the currently held node - but that is not what happens.
Instead, walk the list backwards and stop a the held node.

Also, paint_node_damage_below() is used when moving paint nodes between
planes, and in these cases we definitely don't want to limit damage to
the current plane.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2023-07-20 14:52:08 -05:00
parent 550c4c3dbc
commit 43b59786e6
1 changed files with 5 additions and 4 deletions

View File

@ -157,11 +157,12 @@ paint_node_damage_below(struct weston_paint_node *pnode)
if (!pnode->plane)
return;
wl_list_for_each(lower_node, &pnode->z_order_link,
z_order_link) {
wl_list_for_each_reverse(lower_node,
&pnode->output->paint_node_z_order_list,
z_order_link) {
if (lower_node->plane != pnode->plane)
continue;
if (lower_node == pnode)
break;
pixman_region32_union(&lower_node->damage, &lower_node->damage,
&pnode->visible);