background-content: Apply Cullable clipping even in the transformed case

Just like we used to before 30809665d8.

Because in some cases `clip_region` is able to shave off an extra pixel
from the edge of the redraw rectangle(s). And not shaving that off was
making the background rendering inconsistent with shaped-texture, causing
occasional off-by-one artefacts. Now both shaped-texture and
background-content agree on the clip region again that doesn't happen.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1443

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1464
This commit is contained in:
Daniel van Vugt 2020-10-01 18:01:46 +08:00
parent 4e9a2e4799
commit 64d34a7648

View File

@ -557,15 +557,23 @@ meta_background_content_paint_content (ClutterContent *content,
region = cairo_region_create_rectangle (&rect_within_stage);
}
}
if (self->unobscured_region)
cairo_region_intersect (region, self->unobscured_region);
}
else /* actor and stage space are different but we need actor space */
{
region = cairo_region_create_rectangle (&rect_within_actor);
if (self->clip_region)
{
region = cairo_region_copy (self->clip_region);
cairo_region_intersect_rectangle (region, &rect_within_actor);
}
else
{
region = cairo_region_create_rectangle (&rect_within_actor);
}
}
if (self->unobscured_region)
cairo_region_intersect (region, self->unobscured_region);
/* region is now in actor space */
if (cairo_region_is_empty (region))
{