#define READ_ACCESS(f) ((image->common.read_func)? f##_accessors : f)
#define WRITE_ACCESS(f) ((image->common.write_func)? f##_accessors : f)
+/* Store functions */
+
+static void
+bits_image_store_scanline_32 (bits_image_t *image, int x, int y, int width, uint32_t *buffer)
+{
+ uint32_t *bits;
+ int32_t stride;
+ const pixman_indexed_t * indexed = image->indexed;
+
+ bits = image->bits;
+ stride = image->rowstride;
+ bits += y*stride;
+
+ image->store_scanline_raw_32 ((pixman_image_t *)image, bits, buffer, x, width, indexed);
+
+ if (image->common.alpha_map)
+ {
+ x -= image->common.alpha_origin.x;
+ y -= image->common.alpha_origin.y;
+
+ bits_image_store_scanline_32 (image->common.alpha_map, x, y, width, buffer);
+ }
+}
+
+static void
+bits_image_store_scanline_64 (bits_image_t *image, int x, int y, int width, uint32_t *buffer)
+{
+ uint32_t *bits;
+ int32_t stride;
+ const pixman_indexed_t * indexed = image->indexed;
+
+ bits = image->bits;
+ stride = image->rowstride;
+ bits += y*stride;
+
+ image->store_scanline_raw_64 ((pixman_image_t *)image, bits, (uint64_t *)buffer, x, width, indexed);
+
+ if (image->common.alpha_map)
+ {
+ x -= image->common.alpha_origin.x;
+ y -= image->common.alpha_origin.y;
+
+ bits_image_store_scanline_64 (image->common.alpha_map, x, y, width, buffer);
+ }
+}
+
+void
+_pixman_image_store_scanline_32 (bits_image_t *image, int x, int y, int width,
+ uint32_t *buffer)
+{
+ image->store_scanline_32 (image, x, y, width, buffer);
+}
+
+void
+_pixman_image_store_scanline_64 (bits_image_t *image, int x, int y, int width,
+ uint32_t *buffer)
+{
+ image->store_scanline_64 (image, x, y, width, buffer);
+}
+
+/* Fetch functions */
static void
fbFetchSolid(bits_image_t * image,
int x, int y, int width,
{
uint32_t color;
uint32_t *end;
- fetchPixelProc32 fetch =
- READ_ACCESS(pixman_fetchPixelProcForPicture32)(image);
- color = fetch(image, 0, 0);
+ color = image->fetch_pixel(image, 0, 0);
end = buffer + width;
while (buffer < end)
{
uint64_t color;
uint64_t *end;
- fetchPixelProc64 fetch =
- READ_ACCESS(pixman_fetchPixelProcForPicture64)(image);
- color = fetch(image, 0, 0);
+ color = image->fetch_pixel(image, 0, 0);
end = buffer + width;
while (buffer < end)
image->fetch_scanline_raw_64(image, x, y, width, buffer);
}
-static void
-bits_image_store_scanline_32 (bits_image_t *image, int x, int y, int width, uint32_t *buffer)
-{
- uint32_t *bits;
- int32_t stride;
- const pixman_indexed_t * indexed = image->indexed;
- bits = image->bits;
- stride = image->rowstride;
- bits += y*stride;
- image->store_scanline_raw_32 ((pixman_image_t *)image, bits, buffer, x, width, indexed);
-
- if (image->common.alpha_map)
- {
- x -= image->common.alpha_origin.x;
- y -= image->common.alpha_origin.y;
-
- bits_image_store_scanline_32 (image->common.alpha_map, x, y, width, buffer);
- }
-}
-
-static void
-bits_image_store_scanline_64 (bits_image_t *image, int x, int y, int width, uint32_t *buffer)
-{
- uint32_t *bits;
- int32_t stride;
- const pixman_indexed_t * indexed = image->indexed;
-
- bits = image->bits;
- stride = image->rowstride;
- bits += y*stride;
-
- image->store_scanline_raw_64 ((pixman_image_t *)image, bits, (uint64_t *)buffer, x, width, indexed);
-
- if (image->common.alpha_map)
- {
- x -= image->common.alpha_origin.x;
- y -= image->common.alpha_origin.y;
-
- bits_image_store_scanline_64 (image->common.alpha_map, x, y, width, buffer);
- }
-}
/* On entry, @buffer should contain @n_pixels (x, y) coordinate pairs, where
* x and y are both uint32_ts. On exit, buffer will contain the corresponding
bits->fetch_pixel = READ_ACCESS(pixman_fetchPixelProcForPicture32)(bits);
}
-
-void
-_pixman_image_store_scanline_32 (bits_image_t *image, int x, int y, int width,
- uint32_t *buffer)
-{
- image->store_scanline_32 (image, x, y, width, buffer);
-}
-
-void
-_pixman_image_store_scanline_64 (bits_image_t *image, int x, int y, int width,
- uint32_t *buffer)
-{
- image->store_scanline_64 (image, x, y, width, buffer);
-}
-
static uint32_t *
create_bits (pixman_format_code_t format,
int width,