surface-actor: Cull out surfaces without alpha channel

If a opaque region is explicitly set we should not consider the surface
opaque, as that implies e.g. a shape region is set.

If no opque region is set but the texture does not have an alpha channel,
we can savely cull it out.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1082
This commit is contained in:
Robert Mader 2020-02-23 16:37:50 +01:00 committed by Carlos Garnacho
parent 0ada90024f
commit 372d73e275

View File

@ -274,6 +274,18 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
opaque_region = meta_shaped_texture_get_opaque_region (priv->texture);
if (!opaque_region && 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);
}
if (!opaque_region)
return;