aboutsummaryrefslogtreecommitdiff
path: root/pixman/test/utils.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-12 15:21:19 +0000
committermarha <marha@users.sourceforge.net>2011-03-12 15:21:19 +0000
commite0058f158bae56c5a10cad4f9ace808a27022a9d (patch)
tree0daf3e4bafd8a1c53f8228c41ffd1637c158bb29 /pixman/test/utils.c
parentb639ce1e238ac06882d504aca591ab62475459c1 (diff)
parent77ec02adbc8f9657e7749b307d3cc86ccbd163ea (diff)
downloadvcxsrv-e0058f158bae56c5a10cad4f9ace808a27022a9d.tar.gz
vcxsrv-e0058f158bae56c5a10cad4f9ace808a27022a9d.tar.bz2
vcxsrv-e0058f158bae56c5a10cad4f9ace808a27022a9d.zip
svn merge ^/branches/released .
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;
}
}