8 main (int argc, char **argv)
13 pixman_image_t *src_img;
14 pixman_image_t *mask_img;
15 pixman_image_t *dest_img;
17 pixman_color_t white = { 0x0000, 0xffff, 0x0000, 0xffff };
18 uint32_t *bits = malloc (WIDTH * HEIGHT * 4);
19 uint32_t *mbits = malloc (WIDTH * HEIGHT);
21 memset (mbits, 0, WIDTH * HEIGHT);
22 memset (bits, 0xff, WIDTH * HEIGHT * 4);
24 trap.top.l = pixman_int_to_fixed (50) + 0x8000;
25 trap.top.r = pixman_int_to_fixed (150) + 0x8000;
26 trap.top.y = pixman_int_to_fixed (30);
28 trap.bot.l = pixman_int_to_fixed (50) + 0x8000;
29 trap.bot.r = pixman_int_to_fixed (150) + 0x8000;
30 trap.bot.y = pixman_int_to_fixed (150);
32 mask_img = pixman_image_create_bits (PIXMAN_a8, WIDTH, HEIGHT, mbits, WIDTH);
33 src_img = pixman_image_create_solid_fill (&white);
34 dest_img = pixman_image_create_bits (PIXMAN_a8r8g8b8, WIDTH, HEIGHT, bits, WIDTH * 4);
36 pixman_add_traps (mask_img, 0, 0, 1, &trap);
38 pixman_image_composite (PIXMAN_OP_OVER,
39 src_img, mask_img, dest_img,
40 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
42 show_image (dest_img);
44 pixman_image_unref (src_img);
45 pixman_image_unref (dest_img);