aboutsummaryrefslogtreecommitdiff
path: root/pixman/test/rotate-test.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/rotate-test.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/rotate-test.c')
-rw-r--r--pixman/test/rotate-test.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/pixman/test/rotate-test.c b/pixman/test/rotate-test.c
index 9d2a620cb..18ca60d9b 100644
--- a/pixman/test/rotate-test.c
+++ b/pixman/test/rotate-test.c
@@ -61,16 +61,25 @@ static pixman_image_t *
make_image (void)
{
pixman_format_code_t format = RANDOM_FORMAT();
- uint32_t *bytes = malloc (WIDTH * HEIGHT * 4);
+ uint32_t *bytes, *orig;
pixman_image_t *image;
+ int stride;
+ orig = bytes = malloc (WIDTH * HEIGHT * 4);
prng_randmemset (bytes, WIDTH * HEIGHT * 4, 0);
+ stride = WIDTH * 4;
+ if (prng_rand_n (2) == 0)
+ {
+ bytes += (stride / 4) * (HEIGHT - 1);
+ stride = - stride;
+ }
+
image = pixman_image_create_bits (
- format, WIDTH, HEIGHT, bytes, WIDTH * 4);
+ format, WIDTH, HEIGHT, bytes, stride);
pixman_image_set_transform (image, RANDOM_TRANSFORM());
- pixman_image_set_destroy_function (image, on_destroy, bytes);
+ pixman_image_set_destroy_function (image, on_destroy, orig);
pixman_image_set_repeat (image, PIXMAN_REPEAT_NORMAL);
image_endian_swap (image);
@@ -106,6 +115,6 @@ int
main (int argc, const char *argv[])
{
return fuzzer_test_main ("rotate", 15000,
- 0xECF5E426,
+ 0x81E9EC2F,
test_transform, argc, argv);
}