aboutsummaryrefslogtreecommitdiff
path: root/pixman/test/utils.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-09-20 11:58:12 +0200
committermarha <marha@users.sourceforge.net>2013-09-20 11:58:12 +0200
commita5179a42a3376f0d8c1d01456235b044854d8bdc (patch)
tree04018368b95d6eb802adbf083fdd774a0336be51 /pixman/test/utils.c
parent4888b09cfc72713f460dd7457fb2b7eca0abb91c (diff)
parent55c05b8a12944349b00053253d3a49b223a9f4de (diff)
downloadvcxsrv-a5179a42a3376f0d8c1d01456235b044854d8bdc.tar.gz
vcxsrv-a5179a42a3376f0d8c1d01456235b044854d8bdc.tar.bz2
vcxsrv-a5179a42a3376f0d8c1d01456235b044854d8bdc.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig mesa pixman git update 20 Sep 2013
Diffstat (limited to 'pixman/test/utils.c')
-rw-r--r--pixman/test/utils.c38
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