#define PIXMAN_COMPOSITE_RECT_GENERAL pixman_composite_rect_general_no_accessors
#endif
-static void
-fbStore(bits_image_t * pict, int x, int y, int width, uint32_t *buffer)
-{
- uint32_t *bits;
- int32_t stride;
- storeProc32 store = ACCESS(pixman_storeProcForPicture32)(pict);
- const pixman_indexed_t * indexed = pict->indexed;
-
- bits = pict->bits;
- stride = pict->rowstride;
- bits += y*stride;
- store((pixman_image_t *)pict, bits, buffer, x, width, indexed);
-}
-
-static void
-fbStore64(bits_image_t * pict, int x, int y, int width, uint64_t *buffer)
-{
- uint32_t *bits;
- int32_t stride;
- storeProc64 store = ACCESS(pixman_storeProcForPicture64)(pict);
- const pixman_indexed_t * indexed = pict->indexed;
-
- bits = pict->bits;
- stride = pict->rowstride;
- bits += y*stride;
- store((pixman_image_t *)pict, bits, buffer, x, width, indexed);
-}
-
-static inline scanStoreProc get_store(const int wide)
-{
- if (wide)
- return (scanStoreProc)fbStore64;
- else
- return (scanStoreProc)fbStore;
-}
-
-static inline scanStoreProc get_store_external_alpha(const int wide)
-{
- if (wide)
- return (scanStoreProc)ACCESS(fbStoreExternalAlpha64);
- else
- return (scanStoreProc)ACCESS(fbStoreExternalAlpha);
-}
-
#ifndef PIXMAN_FB_ACCESSORS
static
#endif
else
fetchDest = _pixman_image_get_fetcher (data->dest, wide);
- if (data->dest->common.alpha_map)
- {
- store = get_store_external_alpha(wide);
- }
- else
- {
- store = get_store(wide);
+ store = _pixman_image_get_storer (data->dest, wide);
#ifndef PIXMAN_FB_ACCESSORS
- // Skip the store step and composite directly into the
- // destination if the output format of the compose func matches
- // the destination format.
- if (!wide &&
- (data->op == PIXMAN_OP_ADD || data->op == PIXMAN_OP_OVER) &&
- (data->dest->bits.format == PIXMAN_a8r8g8b8 ||
- data->dest->bits.format == PIXMAN_x8r8g8b8))
- {
- store = NULL;
- }
-#endif
+ // Skip the store step and composite directly into the
+ // destination if the output format of the compose func matches
+ // the destination format.
+ if (!wide &&
+ !data->dest->common.alpha_map &&
+ (data->op == PIXMAN_OP_ADD || data->op == PIXMAN_OP_OVER) &&
+ (data->dest->bits.format == PIXMAN_a8r8g8b8 ||
+ data->dest->bits.format == PIXMAN_x8r8g8b8))
+ {
+ store = NULL;
}
+#endif
if (!store)
{
}
}
+#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;
+ }
+}
+
/* Ref Counting */
PIXMAN_EXPORT pixman_image_t *
pixman_image_ref (pixman_image_t *image)