From 453f813bb4afd39eb5b6b3c4a822894e04b6b11b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 24 Sep 2016 14:37:28 +0300 Subject: [PATCH] glamor: Properly handle mask formats without alpha. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Michel Dänzer --- 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 d4d69a695..f5651eb87 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) {