10 pixman_format_code_t format;
29 const composite_info_t info[] =
33 { 3, 6, 16, PIXMAN_a8r8g8b8 },
34 { 5, 7, 20, PIXMAN_x8r8g8b8 },
41 { 7, 5, 36, PIXMAN_a8r8g8b8 },
42 { 6, 5, 28, PIXMAN_x8r8g8b8 },
49 { 10, 10, 40, PIXMAN_a2b10g10r10 },
50 { 10, 10, 40, PIXMAN_a2b10g10r10 },
57 { 10, 10, 40, PIXMAN_x2b10g10r10 },
58 { 10, 10, 40, PIXMAN_x2b10g10r10 },
65 static pixman_image_t *
66 make_image (const image_info_t *info)
68 char *data = malloc (info->stride * info->height);
71 for (i = 0; i < info->height * info->stride; ++i)
72 data[i] = (i % 255) ^ (((i % 16) << 4) | (i & 0xf0));
74 return pixman_image_create_bits (info->format, info->width, info->height, (uint32_t *)data, info->stride);
78 test_composite (const composite_info_t *info)
80 pixman_image_t *src = make_image (&info->src);
81 pixman_image_t *dest = make_image (&info->dest);
83 pixman_image_composite (PIXMAN_OP_SRC, src, NULL, dest,
84 info->src_x, info->src_y,
86 info->dest_x, info->dest_y,
87 info->width, info->height);
93 main (int argc, char **argv)
97 for (i = 0; i < ARRAY_LENGTH (info); ++i)
98 test_composite (&info[i]);