summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mader <robert.mader@posteo.de>2020-10-01 01:38:16 +0200
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2020-10-02 15:09:12 +0000
commit78592cbcc86e78070eac978403d80ae5ec9089c8 (patch)
treecd2144f4bccf7636ab2a3832c2894afc4e5178a9
parent71f03a718d4312589dd7048299ed1f32e740c4fa (diff)
downloadmutter-78592cbcc86e78070eac978403d80ae5ec9089c8.tar.gz
surface-actor: Simplify culling logic
This reverts the commits 372d73e2757 and 1d2004524728 - the special case for alpha-less textures could only happen on Wayland, but now the opaque region is also set in those cases. This commit saves us some allocations, simplifies the logic a bit and makes sure culling uses the same opaque region as our painting paths. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1463
-rw-r--r--src/compositor/meta-surface-actor.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c
index 884a7a2b3..0fa6f64ed 100644
--- a/src/compositor/meta-surface-actor.c
+++ b/src/compositor/meta-surface-actor.c
@@ -295,25 +295,9 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
cairo_region_t *scaled_opaque_region;
opaque_region = meta_shaped_texture_get_opaque_region (priv->texture);
- if (opaque_region)
- {
- cairo_region_reference (opaque_region);
- }
- else if (meta_shaped_texture_is_opaque (priv->texture))
- {
- cairo_rectangle_int_t rect;
-
- rect = (cairo_rectangle_int_t) {
- .width = meta_shaped_texture_get_width (priv->texture),
- .height = meta_shaped_texture_get_height (priv->texture)
- };
- opaque_region = cairo_region_create_rectangle (&rect);
- }
- else
- {
- return;
- }
+ if (!opaque_region)
+ return;
scaled_opaque_region = get_scaled_region (surface_actor,
opaque_region,
@@ -324,7 +308,6 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
if (clip_region)
cairo_region_subtract (clip_region, scaled_opaque_region);
- cairo_region_destroy (opaque_region);
cairo_region_destroy (scaled_opaque_region);
}
}