#define READ_ACCESS(f) ((image->common.read_func)? f##_accessors : f)
+#define WRITE_ACCESS(f) ((image->common.write_func)? f##_accessors : f)
static void
fbFetchSolid(bits_image_t * image,
}
static void
+fbStore(bits_image_t * image, int x, int y, int width, uint32_t *buffer)
+{
+ uint32_t *bits;
+ int32_t stride;
+ storeProc32 store = WRITE_ACCESS(pixman_storeProcForPicture32)(image);
+ const pixman_indexed_t * indexed = image->indexed;
+
+ bits = image->bits;
+ stride = image->rowstride;
+ bits += y*stride;
+ store((pixman_image_t *)image, bits, buffer, x, width, indexed);
+}
+
+static void
+fbStore64 (bits_image_t * image, int x, int y, int width, uint64_t *buffer)
+{
+ uint32_t *bits;
+ int32_t stride;
+ storeProc64 store = WRITE_ACCESS(pixman_storeProcForPicture64)(image);
+ const pixman_indexed_t * indexed = image->indexed;
+
+ bits = image->bits;
+ stride = image->rowstride;
+ bits += y*stride;
+ store((pixman_image_t *)image, bits, buffer, x, width, indexed);
+}
+
+static void
bits_image_property_changed (pixman_image_t *image)
{
bits_image_t *bits = (bits_image_t *)image;
(scanFetchProc)READ_ACCESS(fbFetchExternalAlpha);
}
else if ((bits->common.repeat != PIXMAN_REPEAT_NONE) &&
- bits->width == 1 &&
- bits->height == 1)
+ bits->width == 1 &&
+ bits->height == 1)
{
image->common.get_scanline_64 = (scanFetchProc)fbFetchSolid64;
image->common.get_scanline_32 = (scanFetchProc)fbFetchSolid;
image->common.get_scanline_32 =
(scanFetchProc)READ_ACCESS(fbFetchTransformed);
}
+
+ if (bits->common.alpha_map)
+ {
+ bits->store_scanline_64 =
+ (scanStoreProc)WRITE_ACCESS(fbStoreExternalAlpha64);
+ bits->store_scanline_32 =
+ (scanStoreProc)WRITE_ACCESS(fbStoreExternalAlpha);
+ }
+ else
+ {
+ bits->store_scanline_64 = (scanStoreProc)fbStore64;
+ bits->store_scanline_32 = fbStore;
+ }
+}
+
+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,
else
fetchDest = _pixman_image_get_scanline_32;
- store = _pixman_image_get_storer (data->dest, wide);
-
+ if (wide)
+ store = _pixman_image_store_scanline_64;
+ else
+ store = _pixman_image_store_scanline_32;
+
// Skip the store step and composite directly into the
// destination if the output format of the compose func matches
// the destination format.
compose (dest_buffer, src_buffer, mask_buffer, data->width);
/* write back */
- store (data->dest, data->xDest, data->yDest + i, data->width,
+ store (&(data->dest->bits), data->xDest, data->yDest + i, data->width,
dest_buffer);
}
else
#define WRITE_ACCESS(f) ((image->common.write_func)? f##_accessors : f)
static void
-fbStore(bits_image_t * image, int x, int y, int width, uint32_t *buffer)
-{
- uint32_t *bits;
- int32_t stride;
- storeProc32 store = WRITE_ACCESS(pixman_storeProcForPicture32)(image);
- const pixman_indexed_t * indexed = image->indexed;
-
- bits = image->bits;
- stride = image->rowstride;
- bits += y*stride;
- store((pixman_image_t *)image, bits, buffer, x, width, indexed);
-}
-
-static void
-fbStore64(bits_image_t * image, int x, int y, int width, uint64_t *buffer)
-{
- uint32_t *bits;
- int32_t stride;
- storeProc64 store = WRITE_ACCESS(pixman_storeProcForPicture64)(image);
- const pixman_indexed_t * indexed = image->indexed;
-
- bits = image->bits;
- stride = image->rowstride;
- bits += y*stride;
- store((pixman_image_t *)image, bits, buffer, x, width, indexed);
-}
-
-scanStoreProc
-_pixman_image_get_storer (pixman_image_t *image,
- int wide)
-{
- if (image->common.alpha_map)
- {
- if (wide)
- return (scanStoreProc)WRITE_ACCESS(fbStoreExternalAlpha64);
- else
- return (scanStoreProc)WRITE_ACCESS(fbStoreExternalAlpha);
- }
- else
- {
- if (wide)
- return (scanStoreProc)fbStore64;
- else
- return (scanStoreProc)fbStore;
- }
-}
-
-static void
image_property_changed (pixman_image_t *image)
{
SOURCE_IMAGE_CLASS_VERTICAL,
} source_pict_class_t;
-typedef void (*scanStoreProc)(pixman_image_t *, int, int, int, uint32_t *);
+typedef void (*scanStoreProc)(bits_image_t *img, int x, int y, int width, uint32_t *buffer);
typedef void (*scanFetchProc)(pixman_image_t *, int, int, int, uint32_t *,
uint32_t *, uint32_t);
_pixman_image_get_scanline_64 (pixman_image_t *image, int x, int y, int width,
uint32_t *buffer, uint32_t *unused, uint32_t unused2);
-scanStoreProc
-_pixman_image_get_storer (pixman_image_t *image,
- int wide);
+void
+_pixman_image_store_scanline_32 (bits_image_t *image, int x, int y, int width,
+ uint32_t *buffer);
+/* Even thought the type of buffer is uint32_t *, the function actually expects
+ * a uint64_t *buffer.
+ */
+void
+_pixman_image_store_scanline_64 (bits_image_t *image, int x, int y, int width,
+ uint32_t *buffer);
pixman_image_t *
_pixman_image_allocate (void);
uint32_t * bits;
uint32_t * free_me;
int rowstride; /* in number of uint32_t's */
+
+ scanStoreProc store_scanline_32;
+ scanStoreProc store_scanline_64;
};
union pixman_image