diff options
Diffstat (limited to 'pixman/test')
-rw-r--r-- | pixman/test/Makefile.in | 4 | ||||
-rw-r--r-- | pixman/test/blitters-test.c | 27 |
2 files changed, 28 insertions, 3 deletions
diff --git a/pixman/test/Makefile.in b/pixman/test/Makefile.in index 07063f22f..6d194888f 100644 --- a/pixman/test/Makefile.in +++ b/pixman/test/Makefile.in @@ -216,6 +216,7 @@ FGREP = @FGREP@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ +HAVE_PTHREAD_SETSPECIFIC = @HAVE_PTHREAD_SETSPECIFIC@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -245,6 +246,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ @@ -253,6 +255,7 @@ PIXMAN_VERSION_MAJOR = @PIXMAN_VERSION_MAJOR@ PIXMAN_VERSION_MICRO = @PIXMAN_VERSION_MICRO@ PIXMAN_VERSION_MINOR = @PIXMAN_VERSION_MINOR@ PKG_CONFIG = @PKG_CONFIG@ +PTHREAD_LDFLAGS = @PTHREAD_LDFLAGS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -260,6 +263,7 @@ SHELL = @SHELL@ SSE2_CFLAGS = @SSE2_CFLAGS@ SSE2_LDFLAGS = @SSE2_LDFLAGS@ STRIP = @STRIP@ +TOOLCHAIN_SUPPORTS__THREAD = @TOOLCHAIN_SUPPORTS__THREAD@ VERSION = @VERSION@ VMX_CFLAGS = @VMX_CFLAGS@ abs_builddir = @abs_builddir@ diff --git a/pixman/test/blitters-test.c b/pixman/test/blitters-test.c index 0b4b6c98c..5e33031e4 100644 --- a/pixman/test/blitters-test.c +++ b/pixman/test/blitters-test.c @@ -27,6 +27,8 @@ #include <config.h> #include "utils.h" +static pixman_indexed_t palette; + static void * aligned_malloc (size_t align, size_t size) { @@ -58,6 +60,7 @@ create_random_image (pixman_format_code_t *allowed_formats, while (allowed_formats[n] != -1) n++; fmt = allowed_formats[lcg_rand_n (n)]; + width = lcg_rand_n (max_width) + 1; height = lcg_rand_n (max_height) + 1; stride = (width * PIXMAN_FORMAT_BPP (fmt) + 7) / 8 + @@ -79,6 +82,12 @@ create_random_image (pixman_format_code_t *allowed_formats, img = pixman_image_create_bits (fmt, width, height, buf, stride); + if (PIXMAN_FORMAT_TYPE (fmt) == PIXMAN_TYPE_COLOR || + PIXMAN_FORMAT_TYPE (fmt) == PIXMAN_TYPE_GRAY) + { + pixman_image_set_indexed (img, &palette); + } + image_endian_swap (img, PIXMAN_FORMAT_BPP (fmt)); if (used_fmt) *used_fmt = fmt; @@ -221,7 +230,6 @@ static pixman_format_code_t img_fmt_list[] = { PIXMAN_b2g3r3, PIXMAN_a2r2g2b2, PIXMAN_a2b2g2r2, -#if 0 /* using these crashes the test */ PIXMAN_c8, PIXMAN_g8, PIXMAN_x4c4, @@ -229,7 +237,6 @@ static pixman_format_code_t img_fmt_list[] = { PIXMAN_c4, PIXMAN_g4, PIXMAN_g1, -#endif PIXMAN_x4a4, PIXMAN_a4, PIXMAN_r1g2b1, @@ -418,6 +425,18 @@ test_composite (uint32_t initcrc, int testnum, int verbose) return crc32; } +static void +initialize_palette (void) +{ + int i; + + for (i = 0; i < PIXMAN_MAX_INDEXED; ++i) + palette.rgba[i] = lcg_rand (); + + for (i = 0; i < 32768; ++i) + palette.ent[i] = lcg_rand() & 0xff; +} + int main (int argc, char *argv[]) { @@ -425,6 +444,8 @@ main (int argc, char *argv[]) uint32_t crc = 0; int verbose = getenv ("VERBOSE") != NULL; + initialize_palette(); + if (argc >= 3) { n1 = atoi (argv[1]); @@ -461,7 +482,7 @@ main (int argc, char *argv[]) /* Predefined value for running with all the fastpath functions disabled. It needs to be updated every time when changes are introduced to this program or behavior of pixman changes! */ - if (crc == 0x20CBE02C) + if (crc == 0xA058F792) { printf ("blitters test passed\n"); } |