diff options
author | Andrea Canciani <ranma42@gmail.com> | 2009-09-27 11:40:52 +0200 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@redhat.com> | 2009-09-27 09:35:02 -0400 |
commit | f135f74ff3a4f55262b611b452566daff5e936ce (patch) | |
tree | d8042c2dfd9b9d6e7c613f361c0b5e71cc04f84a | |
parent | 15c14691a71daa29c86cce40ac0b4a14acf8f2fc (diff) |
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.
-rw-r--r-- | test/composite.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 <stdio.h> #include <stdlib.h> /* abort() */ #include <math.h> +#include <config.h> #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); |