From 747160016ba2d0cd42ad6b174cbf927d67c01875 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 22 Apr 2014 16:33:45 -0700 Subject: [PATCH] glamor: Wire alpha to 1 for pictures without alpha bits When sourcing a picture that has no alpha values, make sure any texture fetches wire the alpha value to one. This ensures that bits beyond the depth of the pixmap, or bits other than the RGB values aren't used. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt --- 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 294a4ae..14ab738 100644 --- a/glamor/glamor_render.c +++ b/glamor/glamor_render.c @@ -870,7 +870,10 @@ glamor_composite_choose_shader(CARD8 op, goto fail; } else { - key.source = SHADER_SOURCE_TEXTURE_ALPHA; + if (PICT_FORMAT_A(source->format)) + key.source = SHADER_SOURCE_TEXTURE_ALPHA; + else + key.source = SHADER_SOURCE_TEXTURE; } if (mask) { -- 2.7.4