aboutsummaryrefslogtreecommitdiff
path: root/pixman/test/blitters-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'pixman/test/blitters-test.c')
-rw-r--r--pixman/test/blitters-test.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/pixman/test/blitters-test.c b/pixman/test/blitters-test.c
index a2c6ff4d8..af948350b 100644
--- a/pixman/test/blitters-test.c
+++ b/pixman/test/blitters-test.c
@@ -57,6 +57,13 @@ create_random_image (pixman_format_code_t *allowed_formats,
prng_randmemset (buf, stride * height, RANDMEMSET_MORE_00_AND_FF);
}
+ /* test negative stride */
+ if (prng_rand_n (4) == 0)
+ {
+ buf += (stride / 4) * (height - 1);
+ stride = - stride;
+ }
+
img = pixman_image_create_bits (fmt, width, height, buf, stride);
if (PIXMAN_FORMAT_TYPE (fmt) == PIXMAN_TYPE_COLOR)
@@ -89,6 +96,9 @@ free_random_image (uint32_t initcrc,
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);
@@ -222,7 +232,6 @@ static pixman_format_code_t mask_fmt_list[] = {
uint32_t
test_composite (int testnum, int verbose)
{
- int i;
pixman_image_t *src_img = NULL;
pixman_image_t *dst_img = NULL;
pixman_image_t *mask_img = NULL;
@@ -355,23 +364,7 @@ test_composite (int testnum, int verbose)
src_x, src_y, mask_x, mask_y, dst_x, dst_y, w, h);
if (verbose)
- {
- int j;
-
- printf ("---\n");
- for (i = 0; i < dst_height; i++)
- {
- for (j = 0; j < dst_stride; j++)
- {
- if (j == (dst_width * PIXMAN_FORMAT_BPP (dst_fmt) + 7) / 8)
- printf ("| ");
-
- printf ("%02X ", *((uint8_t *)dstbuf + i * dst_stride + j));
- }
- printf ("\n");
- }
- printf ("---\n");
- }
+ print_image (dst_img);
free_random_image (0, src_img, PIXMAN_null);
crc32 = free_random_image (0, dst_img, dst_fmt);
@@ -402,6 +395,6 @@ main (int argc, const char *argv[])
}
return fuzzer_test_main("blitters", 2000000,
- 0x0CF3283B,
+ 0xAC8FDA98,
test_composite, argc, argv);
}