diff options
author | Daniel van Vugt <daniel.van.vugt@canonical.com> | 2020-10-01 18:01:46 +0800 |
---|---|---|
committer | Daniel van Vugt <daniel.van.vugt@canonical.com> | 2020-10-01 18:13:15 +0800 |
commit | 64d34a76489ce46926ece828259ed4c394730f94 (patch) | |
tree | 8420c8c548776d6b8b436ee489dcf4e58913237a | |
parent | 4e9a2e479969973bf3063c740ceff149036b3af4 (diff) | |
download | mutter-64d34a76489ce46926ece828259ed4c394730f94.tar.gz |
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
-rw-r--r-- | src/compositor/meta-background-content.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/compositor/meta-background-content.c b/src/compositor/meta-background-content.c index bf203aa9a..ce6ee2fff 100644 --- a/src/compositor/meta-background-content.c +++ b/src/compositor/meta-background-content.c @@ -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)) { |