wayland/actor-surface: Always set opaque region on alpha-less textures

Wayland clients using buffers without alpha channel are not expected to
set an opaque region. However, we rely on the opaque region for the fast
painting path in `MetaShapedTexture`.

Thus, make sure to always set an opaque region internally in those cases.
For X11 clients, wo do so already.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1463
This commit is contained in:
Robert Mader 2020-10-01 00:33:45 +02:00 committed by Georges Basile Stavracas Neto
parent 64d34a7648
commit 71f03a718d

View File

@ -225,7 +225,15 @@ meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor
if (!META_IS_XWAYLAND_SURFACE (surface_role)) if (!META_IS_XWAYLAND_SURFACE (surface_role))
{ {
if (surface->opaque_region) if (!meta_shaped_texture_has_alpha (stex))
{
cairo_region_t *opaque_region;
opaque_region = cairo_region_create_rectangle (&surface_rect);
meta_surface_actor_set_opaque_region (surface_actor, opaque_region);
cairo_region_destroy (opaque_region);
}
else if (surface->opaque_region)
{ {
cairo_region_t *opaque_region; cairo_region_t *opaque_region;