From 3f2546b2ef55b661fd8dd69682b38992225e86f6 Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Mon, 29 Apr 2019 01:17:54 +0100 Subject: Initial import of qemu-2.4.1 --- pixman/test/alpha-loop.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 pixman/test/alpha-loop.c (limited to 'pixman/test/alpha-loop.c') diff --git a/pixman/test/alpha-loop.c b/pixman/test/alpha-loop.c new file mode 100644 index 00000000..4d4384d0 --- /dev/null +++ b/pixman/test/alpha-loop.c @@ -0,0 +1,35 @@ +#include +#include +#include "utils.h" + +#define WIDTH 400 +#define HEIGHT 200 + +int +main (int argc, char **argv) +{ + pixman_image_t *a, *d, *s; + uint8_t *alpha; + uint32_t *src, *dest; + + prng_srand (0); + + alpha = make_random_bytes (WIDTH * HEIGHT); + src = (uint32_t *)make_random_bytes (WIDTH * HEIGHT * 4); + dest = (uint32_t *)make_random_bytes (WIDTH * HEIGHT * 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"); + + pixman_image_set_alpha_map (s, a, 0, 0); + pixman_image_set_alpha_map (a, s, 0, 0); + + pixman_image_composite (PIXMAN_OP_SRC, s, NULL, d, 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT); + + pixman_image_unref (s); + + return 0; +} -- cgit v1.2.3