summaryrefslogtreecommitdiff
path: root/uxa
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-15 00:50:20 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-15 00:50:20 +0100
commitf67b45965b527699794ee21174809c5d71c03f22 (patch)
tree043bd04f0dd5fe369c59ad65cc232b6d8f98a6ae /uxa
parent82d07fdf10cac2211af74ebf7d519daacd7084c0 (diff)
uxa: Expand the range of compatible formats to cover all bpp.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'uxa')
-rw-r--r--uxa/uxa-render.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index 1ded55e7..abbd3cf0 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -1320,10 +1320,13 @@ compatible_formats (CARD8 op, PicturePtr dst, PicturePtr src)
if (src->format == dst->format)
return 1;
- if (src->format == PICT_a8r8g8b8 && dst->format == PICT_x8r8g8b8)
- return 1;
-
- if (src->format == PICT_a8b8g8r8 && dst->format == PICT_x8b8g8r8)
+ /* Is the destination an alpha-less version of source? */
+ if (dst->format == PICT_FORMAT(PICT_FORMAT_BPP(src->format),
+ PICT_FORMAT_TYPE(src->format),
+ 0,
+ PICT_FORMAT_R(src->format),
+ PICT_FORMAT_G(src->format),
+ PICT_FORMAT_B(src->format)))
return 1;
/* XXX xrgb is promoted to argb during image upload... */
@@ -1332,11 +1335,10 @@ compatible_formats (CARD8 op, PicturePtr dst, PicturePtr src)
return 1;
#endif
} else if (op == PictOpOver) {
- if (src->format != dst->format)
+ if (PICT_FORMAT_A(src->format))
return 0;
- if (src->format == PICT_x8r8g8b8 || src->format == PICT_x8b8g8r8)
- return 1;
+ return src->format == dst->format;
}
return 0;