From 998d6b3d8c549086fbc8a9f0e309694b23398d8d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 10 Nov 2009 11:00:43 +0000 Subject: [PATCH] uxa: Force alpha bits to fill remaining bits In the case of x8r8g8b8 and similar where the alpha channel is ignored, but should be interpreted as being 1, then it is convenient if those bits are set appropriately in the colour. In order to do so for these formats, where PIXMAN_FORMAT_A() returns 0 we need to compute the alpha channel width as the remaining bits instead. Signed-off-by: Chris Wilson --- uxa/uxa-render.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c index 7c0dbe53..ee1e4e10 100644 --- a/uxa/uxa-render.c +++ b/uxa/uxa-render.c @@ -147,6 +147,8 @@ uxa_get_pixel_from_rgba(CARD32 * pixel, gbits = PICT_FORMAT_G(format); bbits = PICT_FORMAT_B(format); abits = PICT_FORMAT_A(format); + if (abits == 0) + abits = PICT_FORMAT_BPP(format) - (rbits+gbits+bbits); if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) { bshift = 0;