11 pixman_format_code_t format;
30 const composite_info_t info[] =
34 { 3, 6, 16, PIXMAN_a8r8g8b8 },
35 { 5, 7, 20, PIXMAN_x8r8g8b8 },
42 { 7, 5, 36, PIXMAN_a8r8g8b8 },
43 { 6, 5, 28, PIXMAN_x8r8g8b8 },
50 { 10, 10, 40, PIXMAN_a2b10g10r10 },
51 { 10, 10, 40, PIXMAN_a2b10g10r10 },
58 { 10, 10, 40, PIXMAN_x2b10g10r10 },
59 { 10, 10, 40, PIXMAN_x2b10g10r10 },
66 static pixman_image_t *
67 make_image (const image_info_t *info)
69 char *data = malloc (info->stride * info->height);
72 for (i = 0; i < info->height * info->stride; ++i)
73 data[i] = (i % 255) ^ (((i % 16) << 4) | (i & 0xf0));
75 return pixman_image_create_bits (info->format, info->width, info->height, (uint32_t *)data, info->stride);
79 test_composite (const composite_info_t *info)
81 pixman_image_t *src = make_image (&info->src);
82 pixman_image_t *dest = make_image (&info->dest);
84 pixman_image_composite (PIXMAN_OP_SRC, src, NULL, dest,
85 info->src_x, info->src_y,
87 info->dest_x, info->dest_y,
88 info->width, info->height);
94 main (int argc, char **argv)
98 for (i = 0; i < sizeof (info) / sizeof (info[0]); ++i)
99 test_composite (&info[i]);