*/
#include <stdlib.h>
+#include <stdio.h>
#include "pixman.h"
#include "pixman-private.h"
img->bits.bits = bits;
img->bits.rowstride = rowstride / 4; /* we store it in number of uint32_t's */
img->bits.indexed = NULL;
+
+ if (sizeof (pixman_image_t) < sizeof (image_t))
+ {
+ fprintf (stderr, "BUG in pixman: sizeof pixman_image_t < sizeof (image_t)\n");
+ exit (1);
+ }
+ else
+ {
+ fprintf (stderr, "sizeof pixman_image_t: %d\n", sizeof (pixman_image_t));
+ fprintf (stderr, "sizeof image_t: %d\n", sizeof (image_t));
+ }
+
}
void
+#include <stdlib.h>
#include <stdio.h>
#include "pixman.h"
int
main ()
{
- printf ("Hello World\n");
+ uint32_t *src = malloc (10 * 10 * 4);
+ uint32_t *dest = malloc (10 * 10 * 4);
+ pixman_image_t src_img;
+ pixman_image_t dest_img;
+ uint32_t real;
+
+ int i;
+
+ for (i = 0; i < 10 * 10; ++i)
+ src[i] = 0x7f7f0000; /* red */
+
+ for (i = 0; i < 10 * 10; ++i)
+ dest[i] = 0x7f0000ff; /* blue */
+
+ pixman_image_init_bits (&src_img,
+ PIXMAN_a8r8g8b8,
+ 10, 10,
+ src,
+ 10 * 4);
+
+ pixman_image_init_bits (&dest_img,
+ PIXMAN_a8r8g8b8,
+ 10, 10,
+ dest,
+ 10 * 4);
+
+ pixman_image_composite (PIXMAN_OP_OVER, &src_img, NULL, &dest_img,
+ 0, 0, 0, 0, 0, 0, 10, 10);
return 0;
}