diff options
author | marha <marha@users.sourceforge.net> | 2013-09-20 11:47:27 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-09-20 11:47:27 +0200 |
commit | 55c05b8a12944349b00053253d3a49b223a9f4de (patch) | |
tree | ffa9a1d19efffd67daca5f1568fc2394fdbe0534 /pixman/test/utils.c | |
parent | 7f669a708bd35bdf8e842f762ec68f9ad0ec0486 (diff) | |
download | vcxsrv-55c05b8a12944349b00053253d3a49b223a9f4de.tar.gz vcxsrv-55c05b8a12944349b00053253d3a49b223a9f4de.tar.bz2 vcxsrv-55c05b8a12944349b00053253d3a49b223a9f4de.zip |
fontconfig mesa pixman git update 20 Sep 2013
pixman commit aa5c45254eb60ce4c85a25b5343474fb160ffa7c
fontconfig commit 643f8088f0d51107e58d142df47124efec6afab1
mesa commit 1cc3b90d47f92aa0be2d914191fd2f46d2b127d7
Diffstat (limited to 'pixman/test/utils.c')
-rw-r--r-- | pixman/test/utils.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/pixman/test/utils.c b/pixman/test/utils.c index 3d1ba22ae..34007476b 100644 --- a/pixman/test/utils.c +++ b/pixman/test/utils.c @@ -150,6 +150,12 @@ compute_crc32_for_image_internal (uint32_t crc32, uint32_t mask = 0xffffffff; int i; + if (stride < 0) + { + data += (stride / 4) * (height - 1); + stride = - stride; + } + /* mask unused 'x' part */ if (PIXMAN_FORMAT_BPP (fmt) - PIXMAN_FORMAT_DEPTH (fmt) && PIXMAN_FORMAT_DEPTH (fmt) != 0) @@ -238,6 +244,38 @@ compute_crc32_for_image (uint32_t crc32, return crc32; } +void +print_image (pixman_image_t *image) +{ + int i, j; + int width, height, stride; + pixman_format_code_t format; + uint8_t *buffer; + + width = pixman_image_get_width (image); + height = pixman_image_get_height (image); + stride = pixman_image_get_stride (image); + format = pixman_image_get_format (image); + buffer = (uint8_t *)pixman_image_get_data (image); + + if (stride < 0) + stride = - stride; + + printf ("---\n"); + for (i = 0; i < height; i++) + { + for (j = 0; j < stride; j++) + { + if (j == (width * PIXMAN_FORMAT_BPP (format) + 7) / 8) + printf ("| "); + + printf ("%02X ", *((uint8_t *)buffer + i * stride + j)); + } + printf ("\n"); + } + printf ("---\n"); +} + /* perform endian conversion of pixel data */ void |