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/composite-traps-test.c | 46 +++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 25 deletions(-) (limited to 'pixman/test/composite-traps-test.c') diff --git a/pixman/test/composite-traps-test.c b/pixman/test/composite-traps-test.c index 2983eae83..86a035564 100644 --- a/pixman/test/composite-traps-test.c +++ b/pixman/test/composite-traps-test.c @@ -97,19 +97,25 @@ test_composite (int testnum, int src_width = prng_rand_n (MAX_SRC_WIDTH) + 1; int src_height = prng_rand_n (MAX_SRC_HEIGHT) + 1; int src_stride = src_width * src_bpp + prng_rand_n (MAX_STRIDE) * src_bpp; - uint32_t *bits; + uint32_t *bits, *orig; src_x = -(src_width / 4) + prng_rand_n (src_width * 3 / 2); src_y = -(src_height / 4) + prng_rand_n (src_height * 3 / 2); src_stride = (src_stride + 3) & ~3; - bits = (uint32_t *)make_random_bytes (src_stride * src_height); + orig = bits = (uint32_t *)make_random_bytes (src_stride * src_height); + if (prng_rand_n (2) == 0) + { + bits += (src_stride / 4) * (src_height - 1); + src_stride = - src_stride; + } + src_img = pixman_image_create_bits ( src_format, src_width, src_height, bits, src_stride); - pixman_image_set_destroy_function (src_img, destroy_bits, bits); + pixman_image_set_destroy_function (src_img, destroy_bits, orig); if (prng_rand_n (8) == 0) { @@ -153,6 +159,12 @@ test_composite (int testnum, dst_bits = (uint32_t *)make_random_bytes (dst_stride * dst_height); + if (prng_rand_n (2) == 0) + { + dst_bits += (dst_stride / 4) * (dst_height - 1); + dst_stride = - dst_stride; + } + dst_x = -(dst_width / 4) + prng_rand_n (dst_width * 3 / 2); dst_y = -(dst_height / 4) + prng_rand_n (dst_height * 3 / 2); @@ -214,30 +226,14 @@ test_composite (int testnum, pixman_composite_trapezoids (op, src_img, dst_img, mask_format, src_x, src_y, dst_x, dst_y, n_traps, traps); - if (dst_format == PIXMAN_x8r8g8b8) - { - /* ignore unused part */ - for (i = 0; i < dst_stride * dst_height / 4; i++) - dst_bits[i] &= 0xFFFFFF; - } - - image_endian_swap (dst_img); + crc32 = compute_crc32_for_image (0, dst_img); if (verbose) - { - int j; - - for (i = 0; i < dst_height; i++) - { - for (j = 0; j < dst_stride; j++) - printf ("%02X ", *((uint8_t *)dst_bits + i * dst_stride + j)); - - printf ("\n"); - } - } - - crc32 = compute_crc32 (0, dst_bits, dst_stride * dst_height); + print_image (dst_img); + if (dst_stride < 0) + dst_bits += (dst_stride / 4) * (dst_height - 1); + fence_free (dst_bits); pixman_image_unref (src_img); @@ -251,6 +247,6 @@ test_composite (int testnum, int main (int argc, const char *argv[]) { - return fuzzer_test_main("composite traps", 40000, 0x749BCC57, + return fuzzer_test_main("composite traps", 40000, 0xAF41D210, test_composite, argc, argv); } -- cgit v1.2.3