[PATCH xserver v3 03/11] glamor: Properly handle mask formats without alpha.

Eric Anholt eric at anholt.net
Sun Sep 25 20:30:14 UTC 2016


Even if the pixmap's storage has alpha, it may have been uploaded with
garbage in the alpha channel, so we need to force the shader to set
alpha to 1.  This was broken way back in
355334fcd99e4dce62e2be1e27290c9a74ea944f.

Fixes rendercheck -t composite -f x8r8g8b8.

Signed-off-by: Eric Anholt <eric at anholt.net>
---
 glamor/glamor_render.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index d4d69a695d4d..f5651eb87e54 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -868,7 +868,10 @@ glamor_composite_choose_shader(CARD8 op,
                 goto fail;
         }
         else {
-            key.mask = SHADER_MASK_TEXTURE_ALPHA;
+            if (PICT_FORMAT_A(mask->format))
+                key.mask = SHADER_MASK_TEXTURE_ALPHA;
+            else
+                key.mask = SHADER_MASK_TEXTURE;
         }
 
         if (!mask->componentAlpha) {
-- 
2.9.3



More information about the xorg-devel mailing list