11 pixman_format_code_t format;
30 const composite_info_t info[] =
32 { PIXMAN_OP_SRC, { 3, 6, 16, PIXMAN_a8r8g8b8 }, { 5, 7, 20, PIXMAN_x8r8g8b8 }, 1, 8, 1, -1, 1, 8 },
33 { PIXMAN_OP_SRC, { 7, 5, 36, PIXMAN_a8r8g8b8 }, { 6, 5, 28, PIXMAN_x8r8g8b8 }, 8, 5, 5, 3, 1, 2 },
36 static pixman_image_t *
37 make_image (const image_info_t *info)
39 char *data = malloc (info->stride * info->height);
42 for (i = 0; i < info->height * info->stride; ++i)
43 data[i] = (i % 255) ^ (((i % 16) << 4) | (i & 0xf0));
45 return pixman_image_create_bits (info->format, info->width, info->height, (uint32_t *)data, info->stride);
49 test_composite (const composite_info_t *info)
51 pixman_image_t *src = make_image (&info->src);
52 pixman_image_t *dest = make_image (&info->dest);
54 pixman_image_composite (PIXMAN_OP_SRC, src, NULL, dest,
55 info->src_x, info->src_y,
57 info->dest_x, info->dest_y,
58 info->width, info->height);
64 main (int argc, char **argv)
68 for (i = 0; i < sizeof (info) / sizeof (info[0]); ++i)
69 test_composite (&info[i]);