diff options
author | marha <marha@users.sourceforge.net> | 2010-08-18 09:35:37 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-08-18 09:35:37 +0000 |
commit | 2aa7bcf37f00b7884ae166d62db81493ea37934a (patch) | |
tree | e7ad3e04c09c56538993c8a42a53adce5743d9a7 /pixman/test/alpha-loop.c | |
parent | 2744e12e38280c4877311f129d5a5db509b75026 (diff) | |
download | vcxsrv-2aa7bcf37f00b7884ae166d62db81493ea37934a.tar.gz vcxsrv-2aa7bcf37f00b7884ae166d62db81493ea37934a.tar.bz2 vcxsrv-2aa7bcf37f00b7884ae166d62db81493ea37934a.zip |
libxext libx11 libxcb libXinerama libXau pixman xserver git update 18/10/2010
Diffstat (limited to 'pixman/test/alpha-loop.c')
-rw-r--r-- | pixman/test/alpha-loop.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/pixman/test/alpha-loop.c b/pixman/test/alpha-loop.c new file mode 100644 index 000000000..38fc21f5d --- /dev/null +++ b/pixman/test/alpha-loop.c @@ -0,0 +1,29 @@ +#include <stdio.h>
+#include <stdlib.h>
+#include "utils.h"
+
+#define WIDTH 400
+#define HEIGHT 200
+
+int
+main (int argc, char **argv)
+{
+ uint8_t *alpha = make_random_bytes (WIDTH * HEIGHT);
+ uint32_t *src = (uint32_t *)make_random_bytes (WIDTH * HEIGHT * 4);
+ uint32_t *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);
+
+ 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;
+}
|