From 55c05b8a12944349b00053253d3a49b223a9f4de Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 20 Sep 2013 11:47:27 +0200 Subject: fontconfig mesa pixman git update 20 Sep 2013 pixman commit aa5c45254eb60ce4c85a25b5343474fb160ffa7c fontconfig commit 643f8088f0d51107e58d142df47124efec6afab1 mesa commit 1cc3b90d47f92aa0be2d914191fd2f46d2b127d7 --- pixman/test/utils.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'pixman/test/utils.c') 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 -- cgit v1.2.3