From 287c715df62ce313017e93c46f77cb2e4c4d2bb9 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Tue, 20 Jul 2021 13:02:38 +0200 Subject: [PATCH] shaped-texture: Do not apply y-inverts to shape masks This was introduced by accident in commit 1467b6b02a73bca76 y-inverted textures in combination with shape masks appear to be only commonly used with EGLstreams. However, as we draw the shape mask ourselves, we don't want to apply the y-invert to it as testified by the left over `cogl_pipeline_set_layer_matrix()`. Note that we still allow to apply viemports and buffer transforms, as the Xwayland mode setting emulation may use it (in fact only the former, but it probably does not hurt to leave the later as well). Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/1792 Part-of: --- src/compositor/meta-shaped-texture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c index 6a8af828f..f237d82dd 100644 --- a/src/compositor/meta-shaped-texture.c +++ b/src/compositor/meta-shaped-texture.c @@ -368,15 +368,15 @@ get_base_pipeline (MetaShapedTexture *stex, &GRAPHENE_POINT3D_INIT (0.5, 0.5, 0.0)); } + cogl_pipeline_set_layer_matrix (pipeline, 1, &matrix); + if (!stex->is_y_inverted) { graphene_matrix_translate (&matrix, &GRAPHENE_POINT3D_INIT (0, -1, 0)); graphene_matrix_scale (&matrix, 1, -1, 1); - cogl_pipeline_set_layer_matrix (pipeline, 0, &matrix); } cogl_pipeline_set_layer_matrix (pipeline, 0, &matrix); - cogl_pipeline_set_layer_matrix (pipeline, 1, &matrix); if (stex->snippet) cogl_pipeline_add_layer_snippet (pipeline, 0, stex->snippet);