Stefan Dirsch
3ebebb9666
- xwayland-glamor-Ignore-destination-alpha-as-necessary-for-com.patch * Fix when vncviewer fades to white on xwayland (bsc#1215385, https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1154) ------------------------------------------------------------------ OBS-URL: https://build.opensuse.org/request/show/1112032 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xwayland?expand=0&rev=57
69 lines
2.4 KiB
Diff
69 lines
2.4 KiB
Diff
From d1f142891ef346e90c36a7393009ffaac2aa8b38 Mon Sep 17 00:00:00 2001
|
|
From: Michel Dänzer <mdaenzer@redhat.com>
|
|
Date: Tue, 12 Sep 2023 16:57:16 +0200
|
|
Subject: [PATCH] glamor: Ignore destination alpha as necessary for composite operation
|
|
|
|
If the destination drawable is a window with effective depth 24 backed
|
|
by a depth 32 pixmap.
|
|
|
|
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1575
|
|
---
|
|
glamor/glamor_priv.h | 1 +
|
|
glamor/glamor_render.c | 14 +++++++++++++-
|
|
2 files changed, 14 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
|
|
index 898380d82..71aaeb8c2 100644
|
|
--- a/glamor/glamor_priv.h
|
|
+++ b/glamor/glamor_priv.h
|
|
@@ -111,6 +111,7 @@ enum shader_mask {
|
|
enum shader_dest_swizzle {
|
|
SHADER_DEST_SWIZZLE_DEFAULT,
|
|
SHADER_DEST_SWIZZLE_ALPHA_TO_RED,
|
|
+ SHADER_DEST_SWIZZLE_IGNORE_ALPHA,
|
|
SHADER_DEST_SWIZZLE_COUNT,
|
|
};
|
|
|
|
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
|
|
index ed1222621..0d233f27b 100644
|
|
--- a/glamor/glamor_render.c
|
|
+++ b/glamor/glamor_render.c
|
|
@@ -197,6 +197,11 @@ glamor_create_composite_fs(glamor_screen_private *glamor_priv, struct shader_key
|
|
" float undef;\n"
|
|
" return vec4(color.a, undef, undef, undef);"
|
|
"}";
|
|
+ const char *dest_swizzle_ignore_alpha =
|
|
+ "vec4 dest_swizzle(vec4 color)\n"
|
|
+ "{"
|
|
+ " return vec4(color.xyz, 1.0);"
|
|
+ "}";
|
|
|
|
const char *in_normal =
|
|
"void main()\n"
|
|
@@ -286,6 +291,9 @@ glamor_create_composite_fs(glamor_screen_private *glamor_priv, struct shader_key
|
|
case SHADER_DEST_SWIZZLE_ALPHA_TO_RED:
|
|
dest_swizzle = dest_swizzle_alpha_to_red;
|
|
break;
|
|
+ case SHADER_DEST_SWIZZLE_IGNORE_ALPHA:
|
|
+ dest_swizzle = dest_swizzle_ignore_alpha;
|
|
+ break;
|
|
default:
|
|
FatalError("Bad composite shader dest swizzle");
|
|
}
|
|
@@ -938,7 +946,11 @@ glamor_composite_choose_shader(CARD8 op,
|
|
glamor_priv->formats[8].format == GL_RED) {
|
|
key.dest_swizzle = SHADER_DEST_SWIZZLE_ALPHA_TO_RED;
|
|
} else {
|
|
- key.dest_swizzle = SHADER_DEST_SWIZZLE_DEFAULT;
|
|
+ if (dest_pixmap->drawable.depth == 32 &&
|
|
+ glamor_drawable_effective_depth(dest->pDrawable) == 24)
|
|
+ key.dest_swizzle = SHADER_DEST_SWIZZLE_IGNORE_ALPHA;
|
|
+ else
|
|
+ key.dest_swizzle = SHADER_DEST_SWIZZLE_DEFAULT;
|
|
}
|
|
|
|
if (source && source->alphaMap) {
|
|
--
|
|
2.42.0
|
|
|