diff options
author | marha <marha@users.sourceforge.net> | 2013-06-04 09:07:26 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-06-04 09:48:59 +0200 |
commit | fd2b28971a2afbf54b6cb641aa6a2d5e940a1450 (patch) | |
tree | 1b103a8b2114125ffa8d79827d931aba3744a0d2 /pixman/test | |
parent | 62a1ce0583cf41c173f4edb91511430b552e04da (diff) | |
download | vcxsrv-fd2b28971a2afbf54b6cb641aa6a2d5e940a1450.tar.gz vcxsrv-fd2b28971a2afbf54b6cb641aa6a2d5e940a1450.tar.bz2 vcxsrv-fd2b28971a2afbf54b6cb641aa6a2d5e940a1450.zip |
xwininfo fontconfig libX11 libXau libXdmcp libXext mesa libXinerama libxcb libxcb/xcb-proto libfontenc pixman xkbcomp mkfontscale xkeyboard-config git update 4 Jun 2013
xserver commit c21344add2fc589df83b29be5831c36a372201bd
libxcb commit 9ae84ad187e2ba440c40f44b8eb21c82c2fdbf12
libxcb/xcb-proto commit bdfedfa57a13ff805580cfacafc70f9cc55df363
xkeyboard-config commit dad9ade4e83d1ef5a517fcc4cc9ad3a79b47acce
libX11 commit 8496122eb00ce6cd5d2308ee54f64b68c378e455
libXdmcp commit 0b443c1b769b9c9a3b45b4252afe07e18b709ff4
libXext commit d8366afbb0d2e4fbb1e419b1187f490522270bea
libfontenc commit 3acba630d8b57084f7e92c15732408711ed5137a
libXinerama commit 6e1d1dc328ba8162bba2f4694e7f3c706a1491ff
libXau commit 899790011304c4029e15abf410e49ce7cec17e0a
xkbcomp commit ed582f4fccd4e23abcfba8b3b03649fea6414f44
pixman commit 2acfac5f8e097ee2ae225d986f981b55d65dd152
mkfontscale commit 19e2cb7c6a3ec2c5b1bc0d24866fa685eef0ee13
xwininfo commit ba0d1b0da21d2dbdd81098ed5778f3792b472e13
fontconfig commit cd9b1033a68816a7acfbba1718ba0aa5888f6ec7
mesa commit 7bafd88c153e395274b632e7eae4bc9fc3aec1d2
Diffstat (limited to 'pixman/test')
-rw-r--r-- | pixman/test/blitters-test.c | 13 | ||||
-rw-r--r-- | pixman/test/lowlevel-blt-bench.c | 13 | ||||
-rw-r--r-- | pixman/test/prng-test.c | 5 | ||||
-rw-r--r-- | pixman/test/utils-prng.c | 58 | ||||
-rw-r--r-- | pixman/test/utils-prng.h | 5 |
5 files changed, 83 insertions, 11 deletions
diff --git a/pixman/test/blitters-test.c b/pixman/test/blitters-test.c index 8766fa800..a2c6ff4d8 100644 --- a/pixman/test/blitters-test.c +++ b/pixman/test/blitters-test.c @@ -46,7 +46,16 @@ create_random_image (pixman_format_code_t *allowed_formats, /* do the allocation */ buf = aligned_malloc (64, stride * height); - prng_randmemset (buf, stride * height, RANDMEMSET_MORE_00_AND_FF); + if (prng_rand_n (4) == 0) + { + /* uniform distribution */ + prng_randmemset (buf, stride * height, 0); + } + else + { + /* significantly increased probability for 0x00 and 0xFF */ + prng_randmemset (buf, stride * height, RANDMEMSET_MORE_00_AND_FF); + } img = pixman_image_create_bits (fmt, width, height, buf, stride); @@ -393,6 +402,6 @@ main (int argc, const char *argv[]) } return fuzzer_test_main("blitters", 2000000, - 0xD8265D5E, + 0x0CF3283B, test_composite, argc, argv); } diff --git a/pixman/test/lowlevel-blt-bench.c b/pixman/test/lowlevel-blt-bench.c index 4e16f7ba1..1049e21e7 100644 --- a/pixman/test/lowlevel-blt-bench.c +++ b/pixman/test/lowlevel-blt-bench.c @@ -385,6 +385,7 @@ bench_composite (char * testname, double t1, t2, t3, pix_cnt; int64_t n, l1test_width, nlines; double bytes_per_pix = 0; + pixman_bool_t bench_pixbuf = FALSE; pixman_composite_func_t func = pixman_image_composite_wrapper; @@ -422,16 +423,20 @@ bench_composite (char * testname, mask_img = NULL; xmask_img = NULL; + if (strcmp (testname, "pixbuf") == 0 || strcmp (testname, "rpixbuf") == 0) + { + bench_pixbuf = TRUE; + } if (!(mask_flags & SOLID_FLAG) && mask_fmt != PIXMAN_null) { bytes_per_pix += (mask_fmt >> 24) / ((op == PIXMAN_OP_SRC) ? 8.0 : 4.0); mask_img = pixman_image_create_bits (mask_fmt, WIDTH, HEIGHT, - mask, + bench_pixbuf ? src : mask, WIDTH * 4); xmask_img = pixman_image_create_bits (mask_fmt, XWIDTH, XHEIGHT, - mask, + bench_pixbuf ? src : mask, XWIDTH * 4); } else if (mask_fmt != PIXMAN_null) @@ -643,6 +648,8 @@ tests_tbl[] = { "src_0888_0565", PIXMAN_r8g8b8, 0, PIXMAN_OP_SRC, PIXMAN_null, 0, PIXMAN_r5g6b5 }, { "src_0888_8888", PIXMAN_r8g8b8, 0, PIXMAN_OP_SRC, PIXMAN_null, 0, PIXMAN_a8r8g8b8 }, { "src_0888_x888", PIXMAN_r8g8b8, 0, PIXMAN_OP_SRC, PIXMAN_null, 0, PIXMAN_x8r8g8b8 }, + { "src_0888_8888_rev", PIXMAN_b8g8r8, 0, PIXMAN_OP_SRC, PIXMAN_null, 0, PIXMAN_x8r8g8b8 }, + { "src_0888_0565_rev", PIXMAN_b8g8r8, 0, PIXMAN_OP_SRC, PIXMAN_null, 0, PIXMAN_r5g6b5 }, { "src_x888_x888", PIXMAN_x8r8g8b8, 0, PIXMAN_OP_SRC, PIXMAN_null, 0, PIXMAN_x8r8g8b8 }, { "src_x888_8888", PIXMAN_x8r8g8b8, 0, PIXMAN_OP_SRC, PIXMAN_null, 0, PIXMAN_a8r8g8b8 }, { "src_8888_8888", PIXMAN_a8r8g8b8, 0, PIXMAN_OP_SRC, PIXMAN_null, 0, PIXMAN_a8r8g8b8 }, @@ -707,6 +714,8 @@ tests_tbl[] = { "outrev_n_8888_x888_ca", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_OUT_REV, PIXMAN_a8r8g8b8, 2, PIXMAN_x8r8g8b8 }, { "outrev_n_8888_8888_ca", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_OUT_REV, PIXMAN_a8r8g8b8, 2, PIXMAN_a8r8g8b8 }, { "over_reverse_n_8888", PIXMAN_a8r8g8b8, 0, PIXMAN_OP_OVER_REVERSE, PIXMAN_null, 0, PIXMAN_a8r8g8b8 }, + { "pixbuf", PIXMAN_x8b8g8r8, 0, PIXMAN_OP_SRC, PIXMAN_a8b8g8r8, 0, PIXMAN_a8r8g8b8 }, + { "rpixbuf", PIXMAN_x8b8g8r8, 0, PIXMAN_OP_SRC, PIXMAN_a8b8g8r8, 0, PIXMAN_a8b8g8r8 }, }; int diff --git a/pixman/test/prng-test.c b/pixman/test/prng-test.c index 0a3ad5e8f..c1d9320cc 100644 --- a/pixman/test/prng-test.c +++ b/pixman/test/prng-test.c @@ -106,7 +106,10 @@ int main (int argc, char *argv[]) { const uint32_t ref_crc[RANDMEMSET_MORE_00_AND_FF + 1] = { - 0xBA06763D, 0x103FC550, 0x8B59ABA5, 0xD82A0F39 + 0xBA06763D, 0x103FC550, 0x8B59ABA5, 0xD82A0F39, + 0xD2321099, 0xFD8C5420, 0xD3B7C42A, 0xFC098093, + 0x85E01DE0, 0x6680F8F7, 0x4D32DD3C, 0xAE52382B, + 0x149E6CB5, 0x8B336987, 0x15DCB2B3, 0x8A71B781 }; uint32_t crc1, crc2; uint32_t ref, seed, seed0, seed1, seed2, seed3; diff --git a/pixman/test/utils-prng.c b/pixman/test/utils-prng.c index 967b8989a..7b32e3531 100644 --- a/pixman/test/utils-prng.c +++ b/pixman/test/utils-prng.c @@ -107,6 +107,7 @@ randmemset_internal (prng_t *prng, { prng_t local_prng = *prng; prng_rand_128_data_t randdata; + size_t i; while (size >= 16) { @@ -138,6 +139,22 @@ randmemset_internal (prng_t *prng, }; randdata.vb &= (t.vb >= const_40); } + if (flags & RANDMEMSET_MORE_FFFFFFFF) + { + const uint32x4 const_C0000000 = + { + 0xC0000000, 0xC0000000, 0xC0000000, 0xC0000000 + }; + randdata.vw |= ((t.vw << 30) >= const_C0000000); + } + if (flags & RANDMEMSET_MORE_00000000) + { + const uint32x4 const_40000000 = + { + 0x40000000, 0x40000000, 0x40000000, 0x40000000 + }; + randdata.vw &= ((t.vw << 30) >= const_40000000); + } #else #define PROCESS_ONE_LANE(i) \ if (flags & RANDMEMSET_MORE_FF) \ @@ -155,6 +172,18 @@ randmemset_internal (prng_t *prng, mask_00 |= mask_00 >> 2; \ mask_00 |= mask_00 >> 4; \ randdata.w[i] &= mask_00; \ + } \ + if (flags & RANDMEMSET_MORE_FFFFFFFF) \ + { \ + int32_t mask_ff = ((t.w[i] << 30) & (t.w[i] << 31)) & \ + 0x80000000; \ + randdata.w[i] |= mask_ff >> 31; \ + } \ + if (flags & RANDMEMSET_MORE_00000000) \ + { \ + int32_t mask_00 = ((t.w[i] << 30) | (t.w[i] << 31)) & \ + 0x80000000; \ + randdata.w[i] &= mask_00 >> 31; \ } PROCESS_ONE_LANE (0) @@ -198,7 +227,8 @@ randmemset_internal (prng_t *prng, } size -= 16; } - while (size > 0) + i = 0; + while (i < size) { uint8_t randbyte = prng_rand_r (&local_prng) & 0xFF; if (flags != 0) @@ -208,9 +238,25 @@ randmemset_internal (prng_t *prng, randbyte = 0xFF; if ((flags & RANDMEMSET_MORE_00) && (t < 0x40)) randbyte = 0x00; + if (i % 4 == 0 && i + 4 <= size) + { + t = prng_rand_r (&local_prng) & 0xFF; + if ((flags & RANDMEMSET_MORE_FFFFFFFF) && (t >= 0xC0)) + { + memset(&buf[i], 0xFF, 4); + i += 4; + continue; + } + if ((flags & RANDMEMSET_MORE_00000000) && (t < 0x40)) + { + memset(&buf[i], 0x00, 4); + i += 4; + continue; + } + } } - *buf++ = randbyte; - size--; + buf[i] = randbyte; + i++; } *prng = local_prng; } @@ -218,8 +264,10 @@ randmemset_internal (prng_t *prng, /* * Fill memory buffer with random data. Flags argument may be used * to tweak some statistics properties: - * RANDMEMSET_MORE_00 - set ~25% of bytes to 0x00 - * RANDMEMSET_MORE_FF - set ~25% of bytes to 0xFF + * RANDMEMSET_MORE_00 - set ~25% of bytes to 0x00 + * RANDMEMSET_MORE_FF - set ~25% of bytes to 0xFF + * RANDMEMSET_MORE_00000000 - ~25% chance for 00000000 4-byte clusters + * RANDMEMSET_MORE_FFFFFFFF - ~25% chance for FFFFFFFF 4-byte clusters */ void prng_randmemset_r (prng_t *prng, void *voidbuf, diff --git a/pixman/test/utils-prng.h b/pixman/test/utils-prng.h index 285107f08..564ffcef1 100644 --- a/pixman/test/utils-prng.h +++ b/pixman/test/utils-prng.h @@ -153,7 +153,10 @@ typedef enum { RANDMEMSET_MORE_00 = 1, /* ~25% chance for 0x00 bytes */ RANDMEMSET_MORE_FF = 2, /* ~25% chance for 0xFF bytes */ - RANDMEMSET_MORE_00_AND_FF = (RANDMEMSET_MORE_00 | RANDMEMSET_MORE_FF) + RANDMEMSET_MORE_00000000 = 4, /* ~25% chance for 0x00000000 clusters */ + RANDMEMSET_MORE_FFFFFFFF = 8, /* ~25% chance for 0xFFFFFFFF clusters */ + RANDMEMSET_MORE_00_AND_FF = (RANDMEMSET_MORE_00 | RANDMEMSET_MORE_00000000 | + RANDMEMSET_MORE_FF | RANDMEMSET_MORE_FFFFFFFF) } prng_randmemset_flags_t; /* Set the 32-bit seed for PRNG */ |