7 /* This test demonstrates that clipping is done totally different depending
8 * on whether the source is transformed or not.
11 main (int argc, char **argv)
18 uint32_t *sbits = malloc (SMALL * SMALL * 4);
19 uint32_t *bits = malloc (WIDTH * HEIGHT * 4);
20 pixman_transform_t trans = {
22 { pixman_double_to_fixed (1.0), pixman_double_to_fixed (0), pixman_double_to_fixed (-0.1), },
23 { pixman_double_to_fixed (0), pixman_double_to_fixed (1), pixman_double_to_fixed (-0.1), },
24 { pixman_double_to_fixed (0), pixman_double_to_fixed (0), pixman_double_to_fixed (1.0) }
27 pixman_image_t *src_img = pixman_image_create_bits (PIXMAN_a8r8g8b8, SMALL, SMALL, sbits, 4 * SMALL);
28 pixman_image_t *dest_img = pixman_image_create_bits (PIXMAN_a8r8g8b8, WIDTH, HEIGHT, bits, 4 * WIDTH);
30 memset (bits, 0xff, WIDTH * HEIGHT * 4);
31 memset (sbits, 0x00, SMALL * SMALL * 4);
33 pixman_image_composite (PIXMAN_OP_IN,
34 src_img, NULL, dest_img,
35 0, 0, 0, 0, SMALL, SMALL, 200, 200);
37 pixman_image_set_transform (src_img, &trans);
39 pixman_image_composite (PIXMAN_OP_IN,
40 src_img, NULL, dest_img,
41 0, 0, 0, 0, SMALL * 2, SMALL * 2, 200, 200);
43 show_image (dest_img);
45 pixman_image_unref (src_img);
46 pixman_image_unref (dest_img);