aboutsummaryrefslogtreecommitdiff
path: root/pixman/test/utils.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-12 14:57:48 +0000
committermarha <marha@users.sourceforge.net>2011-03-12 14:57:48 +0000
commit77ec02adbc8f9657e7749b307d3cc86ccbd163ea (patch)
tree8b11e4e5002a05a69a7b7dfe5ce79162448f2aa2 /pixman/test/utils.c
parentf81bb3160c5f39d8f7ad329e99865af88f02b96a (diff)
downloadvcxsrv-77ec02adbc8f9657e7749b307d3cc86ccbd163ea.tar.gz
vcxsrv-77ec02adbc8f9657e7749b307d3cc86ccbd163ea.tar.bz2
vcxsrv-77ec02adbc8f9657e7749b307d3cc86ccbd163ea.zip
libX11 pixman mesa git update 12 Mar 2011
Diffstat (limited to 'pixman/test/utils.c')
-rw-r--r--pixman/test/utils.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/pixman/test/utils.c b/pixman/test/utils.c
index a896e5be1..ee68d272c 100644
--- a/pixman/test/utils.c
+++ b/pixman/test/utils.c
@@ -133,11 +133,12 @@ compute_crc32 (uint32_t in_crc32,
/* perform endian conversion of pixel data
*/
void
-image_endian_swap (pixman_image_t *img, int bpp)
+image_endian_swap (pixman_image_t *img)
{
int stride = pixman_image_get_stride (img);
uint32_t *data = pixman_image_get_data (img);
int height = pixman_image_get_height (img);
+ int bpp = PIXMAN_FORMAT_BPP (pixman_image_get_format (img));
int i, j;
/* swap bytes only on big endian systems */
@@ -145,10 +146,13 @@ image_endian_swap (pixman_image_t *img, int bpp)
if (*(volatile uint8_t *)&endian_check_var != 0x12)
return;
+ if (bpp == 8)
+ return;
+
for (i = 0; i < height; i++)
{
uint8_t *line_data = (uint8_t *)data + stride * i;
- /* swap bytes only for 16, 24 and 32 bpp for now */
+
switch (bpp)
{
case 1:
@@ -208,6 +212,7 @@ image_endian_swap (pixman_image_t *img, int bpp)
}
break;
default:
+ assert (FALSE);
break;
}
}