[mutter/gnome-3-36] surface-actor: Simplify culling logic
- From: Robert Mader <rmader src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-3-36] surface-actor: Simplify culling logic
- Date: Wed, 7 Oct 2020 18:00:16 +0000 (UTC)
commit e120c8eb0c9259743395200ef36c663eeedccc7f
Author: Robert Mader <robert mader posteo de>
Date: Thu Oct 1 01:38:16 2020 +0200
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
(cherry picked from commit 78592cbcc86e78070eac978403d80ae5ec9089c8)
src/compositor/meta-surface-actor.c | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)
---
diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c
index 050c98211e..6cc3a67956 100644
--- a/src/compositor/meta-surface-actor.c
+++ b/src/compositor/meta-surface-actor.c
@@ -301,25 +301,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,
@@ -330,7 +314,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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]