From: Andrea Canciani Date: Sun, 27 Sep 2009 09:40:52 +0000 (+0200) Subject: Fix composite on big-endian systems. X-Git-Tag: pixman-0.17.2~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f135f74ff3a4f55262b611b452566daff5e936ce;p=platform%2Fupstream%2Fpixman.git Fix composite on big-endian systems. Data narrower than 32bpp is padded to an unsigned long and on big-endian systems this shifts the value by the padding bits. --- diff --git a/test/composite.c b/test/composite.c index bcd26ff..7996251 100644 --- a/test/composite.c +++ b/test/composite.c @@ -25,6 +25,7 @@ #include #include /* abort() */ #include +#include #define FALSE 0 #define TRUE !FALSE @@ -502,6 +503,9 @@ get_pixel (pixman_image_t *image, unsigned long val; val = *(unsigned long *) pixman_image_get_data (image); +#ifdef WORDS_BIGENDIAN + val >>= 8 * sizeof(val) - PIXMAN_FORMAT_BPP (format); +#endif /* Number of bits in each channel */ a = PIXMAN_FORMAT_A (format);