1#include <stdio.h>
2#include <stdlib.h>
3#include "pixman.h"
4#include "gtk-utils.h"
5
6int
7main (int argc, char **argv)
8{
9#define WIDTH 40
10#define HEIGHT 40
11
12    uint32_t *src1 = malloc (WIDTH * HEIGHT * 4);
13    uint32_t *src2 = malloc (WIDTH * HEIGHT * 4);
14    uint32_t *src3 = malloc (WIDTH * HEIGHT * 4);
15    uint32_t *dest = malloc (3 * WIDTH * 2 * HEIGHT * 4);
16    pixman_image_t *simg1, *simg2, *simg3, *dimg;
17
18    int i;
19
20    for (i = 0; i < WIDTH * HEIGHT; ++i)
21    {
22	src1[i] = 0x7ff00000;
23	src2[i] = 0x7f00ff00;
24	src3[i] = 0x7f0000ff;
25    }
26
27    for (i = 0; i < 3 * WIDTH * 2 * HEIGHT; ++i)
28    {
29	dest[i] = 0x0;
30    }
31
32    simg1 = pixman_image_create_bits (PIXMAN_a8r8g8b8, WIDTH, HEIGHT, src1, WIDTH * 4);
33    simg2 = pixman_image_create_bits (PIXMAN_a8r8g8b8, WIDTH, HEIGHT, src2, WIDTH * 4);
34    simg3 = pixman_image_create_bits (PIXMAN_a8r8g8b8, WIDTH, HEIGHT, src3, WIDTH * 4);
35    dimg  = pixman_image_create_bits (PIXMAN_a8r8g8b8, 3 * WIDTH, 2 * HEIGHT, dest, 3 * WIDTH * 4);
36
37    pixman_image_composite (PIXMAN_OP_SCREEN, simg1, NULL, dimg, 0, 0, 0, 0, WIDTH, HEIGHT / 4, WIDTH, HEIGHT);
38    pixman_image_composite (PIXMAN_OP_SCREEN, simg2, NULL, dimg, 0, 0, 0, 0, (WIDTH/2), HEIGHT / 4 + HEIGHT / 2, WIDTH, HEIGHT);
39    pixman_image_composite (PIXMAN_OP_SCREEN, simg3, NULL, dimg, 0, 0, 0, 0, (4 * WIDTH) / 3, HEIGHT, WIDTH, HEIGHT);
40
41    show_image (dimg);
42
43    return 0;
44}
45