- Run cairo test suite; fix bugs
- one bug in source-scale-clip
+- Default clip region should be the full image
\ No newline at end of file
AC_PREREQ([2.57])
-AC_INIT(pixman, 0.9.2, "sandmann@daimi.au.dk", pixman)
+AC_INIT(pixman, 0.9.3, "sandmann@daimi.au.dk", pixman)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_CONFIG_HEADER(config.h)
int width,
int height,
uint32_t *bits,
- int rowstride)
+ int rowstride_bytes)
{
pixman_image_t *image;
- return_val_if_fail ((rowstride & 0x3) == 0, NULL); /* must be a
- * multiple of 4
- */
+ /* must be a whole number of uint32_t's
+ */
+ return_val_if_fail ((rowstride_bytes % sizeof (uint32_t)) == 0, NULL);
image = allocate_image();
image->bits.width = width;
image->bits.height = height;
image->bits.bits = bits;
- image->bits.rowstride = rowstride / 4; /* we store it in number
- * of uint32_t's
- */
+ image->bits.rowstride = rowstride_bytes / sizeof (uint32_t); /* we store it in number
+ * of uint32_t's
+ */
image->bits.indexed = NULL;
return image;
}
-#define SCANLINE_BUFFER_LENGTH 2048
-
void
pixman_image_set_accessors (pixman_image_t *image,
pixman_read_memory_func_t read_func,
image->common.write_func = write_func;
}
-void
-pixman_image_composite_rect (pixman_op_t op,
- pixman_image_t *src,
- pixman_image_t *mask,
- pixman_image_t *dest,
- int16_t src_x,
- int16_t src_y,
- int16_t mask_x,
- int16_t mask_y,
- int16_t dest_x,
- int16_t dest_y,
- uint16_t width,
- uint16_t height)
+uint32_t *
+pixman_image_get_data (pixman_image_t *image)
{
- FbComposeData compose_data;
- uint32_t _scanline_buffer[SCANLINE_BUFFER_LENGTH * 3];
- uint32_t *scanline_buffer = _scanline_buffer;
+ return_val_if_fail (image->type == BITS, NULL);
- return_if_fail (src != NULL);
- return_if_fail (dest != NULL);
-
- if (width > SCANLINE_BUFFER_LENGTH)
- {
- scanline_buffer = (uint32_t *)malloc (width * 3 * sizeof (uint32_t));
+ return image->bits.bits;
+}
- if (!scanline_buffer)
- return;
- }
+int
+pixman_image_get_width (pixman_image_t *image)
+{
+ return_val_if_fail (image->type == BITS, -1);
+
+ return image->bits.width;
- compose_data.op = op;
- compose_data.src = src;
- compose_data.mask = mask;
- compose_data.dest = dest;
- compose_data.xSrc = src_x;
- compose_data.ySrc = src_y;
- compose_data.xMask = mask_x;
- compose_data.yMask = mask_y;
- compose_data.xDest = dest_x;
- compose_data.yDest = dest_y;
- compose_data.width = width;
- compose_data.height = height;
-
- pixmanCompositeRect (&compose_data, scanline_buffer);
-
- if (scanline_buffer != _scanline_buffer)
- free (scanline_buffer);
+}
+
+int
+pixman_image_get_height (pixman_image_t *image)
+{
+ return_val_if_fail (image->type == BITS, -1);
+
+ return image->bits.height;
+}
+
+int
+pixman_image_get_stride (pixman_image_t *image)
+{
+ return_val_if_fail (image->type == BITS, -1);
+
+ return sizeof (uint32_t) * image->bits.rowstride;
+}
+
+int
+pixman_image_get_depth (pixman_image_t *image)
+{
+ return_val_if_fail (image->type == BITS, -1);
+
+ return PIXMAN_FORMAT_DEPTH (image->bits.format);
}
}
}
+#define SCANLINE_BUFFER_LENGTH 2048
+
+static void
+pixman_image_composite_rect (pixman_op_t op,
+ pixman_image_t *src,
+ pixman_image_t *mask,
+ pixman_image_t *dest,
+ int16_t src_x,
+ int16_t src_y,
+ int16_t mask_x,
+ int16_t mask_y,
+ int16_t dest_x,
+ int16_t dest_y,
+ uint16_t width,
+ uint16_t height)
+{
+ FbComposeData compose_data;
+ uint32_t _scanline_buffer[SCANLINE_BUFFER_LENGTH * 3];
+ uint32_t *scanline_buffer = _scanline_buffer;
+
+ return_if_fail (src != NULL);
+ return_if_fail (dest != NULL);
+
+ if (width > SCANLINE_BUFFER_LENGTH)
+ {
+ scanline_buffer = (uint32_t *)malloc (width * 3 * sizeof (uint32_t));
+
+ if (!scanline_buffer)
+ return;
+ }
+
+ compose_data.op = op;
+ compose_data.src = src;
+ compose_data.mask = mask;
+ compose_data.dest = dest;
+ compose_data.xSrc = src_x;
+ compose_data.ySrc = src_y;
+ compose_data.xMask = mask_x;
+ compose_data.yMask = mask_y;
+ compose_data.xDest = dest_x;
+ compose_data.yDest = dest_y;
+ compose_data.width = width;
+ compose_data.height = height;
+
+ pixmanCompositeRect (&compose_data, scanline_buffer);
+
+ if (scanline_buffer != _scanline_buffer)
+ free (scanline_buffer);
+}
+
void
pixman_image_composite (pixman_op_t op,
pixman_image_t * pSrc,
pixman_write_memory_func_t write_func);
void pixman_image_set_indexed (pixman_image_t *image,
const pixman_indexed_t *indexed);
+uint32_t *pixman_image_get_data (pixman_image_t *image);
+int pixman_image_get_width (pixman_image_t *image);
+int pixman_image_get_height (pixman_image_t *image);
+int pixman_image_get_stride (pixman_image_t *image);
+int pixman_image_get_depth (pixman_image_t *image);
/* Composite */
pixman_bool_t pixman_compute_composite_region (pixman_region16_t * pRegion,
int16_t yDst,
uint16_t width,
uint16_t height);
-void pixman_image_composite (pixman_op_t op,
- pixman_image_t *src,
- pixman_image_t *mask,
- pixman_image_t *dest,
- int16_t src_x,
- int16_t src_y,
- int16_t mask_x,
- int16_t mask_y,
- int16_t dest_x,
- int16_t dest_y,
- uint16_t width,
- uint16_t height);
-void pixman_image_composite_rect (pixman_op_t op,
- pixman_image_t *src,
- pixman_image_t *mask,
- pixman_image_t *dest,
- int16_t src_x,
- int16_t src_y,
- int16_t mask_x,
- int16_t mask_y,
- int16_t dest_x,
- int16_t dest_y,
- uint16_t width,
- uint16_t height);
+void pixman_image_composite (pixman_op_t op,
+ pixman_image_t *src,
+ pixman_image_t *mask,
+ pixman_image_t *dest,
+ int16_t src_x,
+ int16_t src_y,
+ int16_t mask_x,
+ int16_t mask_y,
+ int16_t dest_x,
+ int16_t dest_y,
+ uint16_t width,
+ uint16_t height);
/*
* Trapezoids
dest,
WIDTH * 4);
- pixman_image_composite_rect (PIXMAN_OP_OVER, src_img, NULL, dest_img,
- 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
+ pixman_image_composite (PIXMAN_OP_OVER, src_img, NULL, dest_img,
+ 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
#if 0
for (i = 0; i < WIDTH; ++i)
#endif
pixman_image_set_transform (src_img, &trans);
- pixman_image_composite_rect (PIXMAN_OP_OVER, src_img, NULL, dest_img,
- 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
+ pixman_image_composite (PIXMAN_OP_OVER, src_img, NULL, dest_img,
+ 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
printf ("0, 0: %x\n", dest[0]);
printf ("10, 10: %x\n", dest[10 * 10 + 10]);