glamor: Wire alpha to 1 for pictures without alpha bits
authorKeith Packard <keithp@keithp.com>
Tue, 22 Apr 2014 23:33:45 +0000 (16:33 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 23 Apr 2014 17:35:26 +0000 (10:35 -0700)
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 <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
glamor/glamor_render.c

index 294a4ae..14ab738 100644 (file)
@@ -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) {