summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2013-09-27 18:29:12 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2013-09-27 18:47:35 -0400
commit95f677cf704c63c78f94f1b0aef1bedaea33a242 (patch)
tree2eeccf831045a80786093ca6351a5f33d403cf2c
parentfa0559eb710ef6252dea5a70ade28a2c167a7a85 (diff)
blitters-test: if verbose, print the image after CRC32 computationnegative-strides
The CRC32 computation will endian swap the image before computing the check sum so that the same bytes will be checked on both big and little endian. When verbose, printing of the image would previously happen before the endian swap which led to different output on big vs. little endian. This patch moves the call to compute_crc32_for_image() out of free_random_image() and places it before the call to print_image() so that the output will now be independent of endianness. V2: Remove comment that is now obsolete
-rw-r--r--test/blitters-test.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/test/blitters-test.c b/test/blitters-test.c
index af948350..adf7b36f 100644
--- a/test/blitters-test.c
+++ b/test/blitters-test.c
@@ -84,25 +84,18 @@ create_random_image (pixman_format_code_t *allowed_formats,
return img;
}
-/* Free random image, and optionally update crc32 based on its data */
-static uint32_t
+static void
free_random_image (uint32_t initcrc,
pixman_image_t *img,
pixman_format_code_t fmt)
{
- uint32_t crc32 = 0;
uint32_t *data = pixman_image_get_data (img);
- if (fmt != PIXMAN_null)
- crc32 = compute_crc32_for_image (initcrc, img);
-
if (img->bits.rowstride < 0)
data += img->bits.rowstride * (img->bits.height - 1);
pixman_image_unref (img);
free (data);
-
- return crc32;
}
static pixman_op_t op_list[] = {
@@ -363,11 +356,13 @@ test_composite (int testnum, int verbose)
pixman_image_composite (op, src_img, mask_img, dst_img,
src_x, src_y, mask_x, mask_y, dst_x, dst_y, w, h);
+ crc32 = compute_crc32_for_image (0, dst_img);
+
if (verbose)
print_image (dst_img);
free_random_image (0, src_img, PIXMAN_null);
- crc32 = free_random_image (0, dst_img, dst_fmt);
+ free_random_image (0, dst_img, dst_fmt);
if (mask_img)
{