diff options
author | marha <marha@users.sourceforge.net> | 2013-08-19 09:03:18 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-08-19 09:03:18 +0200 |
commit | 854ec4da20ddff9b830be0a7d5b81d8cb4774132 (patch) | |
tree | 223425d84b5ea3727f74546c92dee8b03c074158 /pixman/test | |
parent | 0659c77949b38440a2a9ba67e1ee9cacef1f3a7f (diff) | |
download | vcxsrv-854ec4da20ddff9b830be0a7d5b81d8cb4774132.tar.gz vcxsrv-854ec4da20ddff9b830be0a7d5b81d8cb4774132.tar.bz2 vcxsrv-854ec4da20ddff9b830be0a7d5b81d8cb4774132.zip |
fontconfig libX11 libXdmcp libxcb xkeyboard-config mesa pixman xserver git update 19 aug 2013
xserver commit fe7463b8ce0de301c2f82b108c93963424f77219
libxcb commit 5648ddd2b97068f549268284129a438a6845e14c
libxcb/xcb-proto commit 56a82005ac388fcb7a4d1c82e07c7e72eaf69a32
xkeyboard-config commit 87c865aee1844b2cc6b1a5a208116dd095f4d76a
libX11 commit 9b291044a240e5b9b031ed814e0c84e53a1c3084
libXdmcp commit 66514a4af7eaa47e8718434356d7efce95e570cf
libXext commit 7378d4bdbd33ed49ed6cfa5c4f73d7527982aab4
libfontenc commit 3acba630d8b57084f7e92c15732408711ed5137a
libXinerama commit 6e1d1dc328ba8162bba2f4694e7f3c706a1491ff
libXau commit 899790011304c4029e15abf410e49ce7cec17e0a
xkbcomp commit 0ebdf47fd4bc434ac3d2339544c022a869510738
pixman commit 3518a0dafa63098d41e466f73d105b7e3e4b12de
xextproto commit f27fcc99d1cf935cc289933326f7d3baacd5107a
randrproto commit ca7cc541c2e43e6c784df19b4583ac35829d2f72
glproto commit 8e3407e02980d088e20041e79bdcdd3737e7827e
mkfontscale commit f48de13423c7300f4da9f61993b624426b38ddc0
xwininfo commit ba0d1b0da21d2dbdd81098ed5778f3792b472e13
libXft commit c5e760a239afc62a1c75e0509868e35957c8df52
libXmu commit d5dac08d65c4865f311cb62c161dbb1300eecd11
libxtrans commit f6a161f2a003f4da0a2e414b4faa0ee0de0c01f0
fontconfig commit 084cf7c44e985dd48c088d921ad0d9a43b0b00b4
mesa commit d13003f544417db6de44c65a0c118bd2b189458a
Diffstat (limited to 'pixman/test')
-rw-r--r-- | pixman/test/Makefile.sources | 1 | ||||
-rw-r--r-- | pixman/test/alpha-loop.c | 7 | ||||
-rw-r--r-- | pixman/test/matrix-test.c | 53 | ||||
-rw-r--r-- | pixman/test/scaling-bench.c | 69 |
4 files changed, 125 insertions, 5 deletions
diff --git a/pixman/test/Makefile.sources b/pixman/test/Makefile.sources index b5fc740f3..2fabdb574 100644 --- a/pixman/test/Makefile.sources +++ b/pixman/test/Makefile.sources @@ -33,6 +33,7 @@ OTHERPROGRAMS = \ lowlevel-blt-bench \ radial-perf-test \ check-formats \ + scaling-bench \ $(NULL) # Utility functions diff --git a/pixman/test/alpha-loop.c b/pixman/test/alpha-loop.c index eca761537..4d4384d00 100644 --- a/pixman/test/alpha-loop.c +++ b/pixman/test/alpha-loop.c @@ -8,6 +8,7 @@ int main (int argc, char **argv) { + pixman_image_t *a, *d, *s; uint8_t *alpha; uint32_t *src, *dest; @@ -17,9 +18,9 @@ main (int argc, char **argv) src = (uint32_t *)make_random_bytes (WIDTH * HEIGHT * 4); dest = (uint32_t *)make_random_bytes (WIDTH * HEIGHT * 4); - pixman_image_t *a = pixman_image_create_bits (PIXMAN_a8, WIDTH, HEIGHT, (uint32_t *)alpha, WIDTH); - pixman_image_t *d = pixman_image_create_bits (PIXMAN_a8r8g8b8, WIDTH, HEIGHT, dest, WIDTH * 4); - pixman_image_t *s = pixman_image_create_bits (PIXMAN_a2r10g10b10, WIDTH, HEIGHT, src, WIDTH * 4); + a = pixman_image_create_bits (PIXMAN_a8, WIDTH, HEIGHT, (uint32_t *)alpha, WIDTH); + d = pixman_image_create_bits (PIXMAN_a8r8g8b8, WIDTH, HEIGHT, dest, WIDTH * 4); + s = pixman_image_create_bits (PIXMAN_a2r10g10b10, WIDTH, HEIGHT, src, WIDTH * 4); fail_after (5, "Infinite loop detected: 5 seconds without progress\n"); diff --git a/pixman/test/matrix-test.c b/pixman/test/matrix-test.c index 8437dd291..0a5f203f5 100644 --- a/pixman/test/matrix-test.c +++ b/pixman/test/matrix-test.c @@ -70,6 +70,53 @@ pixman_bool_t does_it_fit_fixed_48_16 (__float128 x) #endif +static inline uint32_t +byteswap32 (uint32_t x) +{ + return ((x & ((uint32_t)0xFF << 24)) >> 24) | + ((x & ((uint32_t)0xFF << 16)) >> 8) | + ((x & ((uint32_t)0xFF << 8)) << 8) | + ((x & ((uint32_t)0xFF << 0)) << 24); +} + +static inline uint64_t +byteswap64 (uint64_t x) +{ + return ((x & ((uint64_t)0xFF << 56)) >> 56) | + ((x & ((uint64_t)0xFF << 48)) >> 40) | + ((x & ((uint64_t)0xFF << 40)) >> 24) | + ((x & ((uint64_t)0xFF << 32)) >> 8) | + ((x & ((uint64_t)0xFF << 24)) << 8) | + ((x & ((uint64_t)0xFF << 16)) << 24) | + ((x & ((uint64_t)0xFF << 8)) << 40) | + ((x & ((uint64_t)0xFF << 0)) << 56); +} + +static void +byteswap_transform (pixman_transform_t *t) +{ + int i, j; + + if (is_little_endian ()) + return; + + for (i = 0; i < 3; i++) + for (j = 0; j < 3; j++) + t->matrix[i][j] = byteswap32 (t->matrix[i][j]); +} + +static void +byteswap_vector_48_16 (pixman_vector_48_16_t *v) +{ + int i; + + if (is_little_endian ()) + return; + + for (i = 0; i < 3; i++) + v->v[i] = byteswap64 (v->v[i]); +} + uint32_t test_matrix (int testnum, int verbose) { @@ -90,6 +137,8 @@ test_matrix (int testnum, int verbose) #endif prng_randmemset (&ti, sizeof(ti), 0); prng_randmemset (&vi, sizeof(vi), 0); + byteswap_transform (&ti); + byteswap_vector_48_16 (&vi); for (j = 0; j < 3; j++) { @@ -132,8 +181,6 @@ test_matrix (int testnum, int verbose) else transform_ok = pixman_transform_point_31_16 (&ti, &vi, &result_i); - crc32 = compute_crc32 (crc32, &result_i, sizeof(result_i)); - #ifdef HAVE_FLOAT128 /* compare with a reference 128-bit floating point implementation */ for (j = 0; j < 3; j++) @@ -173,6 +220,8 @@ test_matrix (int testnum, int verbose) } } #endif + byteswap_vector_48_16 (&result_i); + crc32 = compute_crc32 (crc32, &result_i, sizeof (result_i)); } return crc32; } diff --git a/pixman/test/scaling-bench.c b/pixman/test/scaling-bench.c new file mode 100644 index 000000000..b39adeff5 --- /dev/null +++ b/pixman/test/scaling-bench.c @@ -0,0 +1,69 @@ +#include <stdlib.h> +#include "utils.h" + +#define SOURCE_WIDTH 320 +#define SOURCE_HEIGHT 240 + +static pixman_image_t * +make_source (void) +{ + size_t n_bytes = (SOURCE_WIDTH + 2) * (SOURCE_HEIGHT + 2) * 4; + uint32_t *data = malloc (n_bytes); + pixman_image_t *source; + + prng_randmemset (data, n_bytes, 0); + + source = pixman_image_create_bits ( + PIXMAN_a8r8g8b8, SOURCE_WIDTH + 2, SOURCE_HEIGHT + 2, + data, + (SOURCE_WIDTH + 2) * 4); + + pixman_image_set_filter (source, PIXMAN_FILTER_BILINEAR, NULL, 0); + + return source; +} + +int +main () +{ + double scale; + pixman_image_t *src; + + prng_srand (23874); + + src = make_source (); + printf ("# %-6s %-22s %-14s %-12s\n", + "ratio", + "resolutions", + "time / ms", + "time per pixel / ns"); + for (scale = 0.1; scale < 10.005; scale += 0.01) + { + int dest_width = SOURCE_WIDTH * scale + 0.5; + int dest_height = SOURCE_HEIGHT * scale + 0.5; + pixman_fixed_t s = (1 / scale) * 65536.0 + 0.5; + pixman_transform_t transform; + pixman_image_t *dest; + double t1, t2; + + pixman_transform_init_scale (&transform, s, s); + pixman_image_set_transform (src, &transform); + + dest = pixman_image_create_bits ( + PIXMAN_a8r8g8b8, dest_width, dest_height, NULL, -1); + + t1 = gettime(); + pixman_image_composite ( + PIXMAN_OP_OVER, src, NULL, dest, + scale, scale, 0, 0, 0, 0, dest_width, dest_height); + t2 = gettime(); + + printf ("%6.2f : %4dx%-4d => %4dx%-4d : %12.4f : %12.4f\n", + scale, SOURCE_WIDTH, SOURCE_HEIGHT, dest_width, dest_height, + (t2 - t1) * 1000, ((t2 - t1) / (dest_width * dest_height)) * 1000000000); + + pixman_image_unref (dest); + } + + return 0; +} |