/* B = 1.164(Y - 16) + 2.018(U - 128) */
b = 0x012b27 * y + 0x0206a2 * u;
- WRITE(pict, buffer++, 0xff000000 |
- (r >= 0 ? r < 0x1000000 ? r & 0xff0000 : 0xff0000 : 0) |
- (g >= 0 ? g < 0x1000000 ? (g >> 8) & 0x00ff00 : 0x00ff00 : 0) |
- (b >= 0 ? b < 0x1000000 ? (b >> 16) & 0x0000ff : 0x0000ff : 0));
+ WRITE(pict, buffer++, 0xff000000 |
+ (r >= 0 ? r < 0x1000000 ? r & 0xff0000 : 0xff0000 : 0) |
+ (g >= 0 ? g < 0x1000000 ? (g >> 8) & 0x00ff00 : 0x00ff00 : 0) |
+ (b >= 0 ? b < 0x1000000 ? (b >> 16) & 0x0000ff : 0x0000ff : 0));
}
}
}
static void
+fbStoreExternalAlpha (bits_image_t * image, int x, int y, int width,
+ uint32_t *buffer)
+{
+ uint32_t *bits, *alpha_bits;
+ int32_t stride, astride;
+ int ax, ay;
+ storeProc32 store;
+ storeProc32 astore;
+ const pixman_indexed_t * indexed = image->indexed;
+ const pixman_indexed_t * aindexed;
+
+ if (!image->common.alpha_map) {
+ // XXX[AGP]: This should never happen!
+ // fbStore(image, x, y, width, buffer);
+ abort();
+ return;
+ }
+
+ store = WRITE_ACCESS(pixman_storeProcForPicture32)(image);
+ astore = WRITE_ACCESS(pixman_storeProcForPicture32)(image->common.alpha_map);
+ aindexed = image->common.alpha_map->indexed;
+
+ ax = x;
+ ay = y;
+
+ bits = image->bits;
+ stride = image->rowstride;
+
+ alpha_bits = image->common.alpha_map->bits;
+ astride = image->common.alpha_map->rowstride;
+
+ bits += y*stride;
+ alpha_bits += (ay - image->common.alpha_origin.y)*astride;
+
+
+ store((pixman_image_t *)image, bits, buffer, x, width, indexed);
+ astore((pixman_image_t *)image->common.alpha_map,
+ alpha_bits, buffer, ax - image->common.alpha_origin.x, width, aindexed);
+}
+
+static void
+fbStoreExternalAlpha64 (bits_image_t * image, int x, int y, int width,
+ uint64_t *buffer)
+{
+ uint32_t *bits, *alpha_bits;
+ int32_t stride, astride;
+ int ax, ay;
+ storeProc64 store;
+ storeProc64 astore;
+ const pixman_indexed_t * indexed = image->indexed;
+ const pixman_indexed_t * aindexed;
+
+ store = ACCESS(pixman_storeProcForPicture64)(image);
+ astore = ACCESS(pixman_storeProcForPicture64)(image->common.alpha_map);
+ aindexed = image->common.alpha_map->indexed;
+
+ ax = x;
+ ay = y;
+
+ bits = image->bits;
+ stride = image->rowstride;
+
+ alpha_bits = image->common.alpha_map->bits;
+ astride = image->common.alpha_map->rowstride;
+
+ bits += y*stride;
+ alpha_bits += (ay - image->common.alpha_origin.y)*astride;
+
+
+ store((pixman_image_t *)image, bits, buffer, x, width, indexed);
+ astore((pixman_image_t *)image->common.alpha_map,
+ alpha_bits, buffer, ax - image->common.alpha_origin.x, width, aindexed);
+}
+
+static void
bits_image_property_changed (pixman_image_t *image)
{
bits_image_t *bits = (bits_image_t *)image;
if (bits->common.alpha_map)
{
- bits->store_scanline_64 =
- (scanStoreProc)WRITE_ACCESS(fbStoreExternalAlpha64);
- bits->store_scanline_32 =
- (scanStoreProc)WRITE_ACCESS(fbStoreExternalAlpha);
+ bits->store_scanline_64 = (scanStoreProc)fbStoreExternalAlpha64;
+ bits->store_scanline_32 = fbStoreExternalAlpha;
}
else
{
image->store_scanline_64 (image, x, y, width, buffer);
}
-
static uint32_t *
create_bits (pixman_format_code_t format,
int width,
uint64_t *buffer, uint64_t *mask, uint32_t maskBits);
void fbFetchTransformed(bits_image_t *, int x, int y, int width,
uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
-void fbStoreExternalAlpha(bits_image_t *, int x, int y, int width,
- uint32_t *buffer);
void fbFetchExternalAlpha(bits_image_t *, int x, int y, int width,
uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
uint32_t *buffer, uint32_t *mask,
uint32_t maskBits);
-void fbStoreExternalAlpha64(bits_image_t *, int x, int y, int width,
- uint64_t *buffer);
-
-void fbStoreExternalAlpha64_accessors(bits_image_t *, int x, int y, int width,
- uint64_t *buffer);
-
/* end */
typedef enum
if (alpha_buffer != _alpha_buffer)
free(alpha_buffer);
}
-
-void
-ACCESS(fbStoreExternalAlpha)(bits_image_t * pict, int x, int y, int width,
- uint32_t *buffer)
-{
- uint32_t *bits, *alpha_bits;
- int32_t stride, astride;
- int ax, ay;
- storeProc32 store;
- storeProc32 astore;
- const pixman_indexed_t * indexed = pict->indexed;
- const pixman_indexed_t * aindexed;
-
- if (!pict->common.alpha_map) {
- // XXX[AGP]: This should never happen!
- // fbStore(pict, x, y, width, buffer);
- abort();
- return;
- }
-
- store = ACCESS(pixman_storeProcForPicture32)(pict);
- astore = ACCESS(pixman_storeProcForPicture32)(pict->common.alpha_map);
- aindexed = pict->common.alpha_map->indexed;
-
- ax = x;
- ay = y;
-
- bits = pict->bits;
- stride = pict->rowstride;
-
- alpha_bits = pict->common.alpha_map->bits;
- astride = pict->common.alpha_map->rowstride;
-
- bits += y*stride;
- alpha_bits += (ay - pict->common.alpha_origin.y)*astride;
-
-
- store((pixman_image_t *)pict, bits, buffer, x, width, indexed);
- astore((pixman_image_t *)pict->common.alpha_map,
- alpha_bits, buffer, ax - pict->common.alpha_origin.x, width, aindexed);
-}
-
-void
-ACCESS(fbStoreExternalAlpha64)(bits_image_t * pict, int x, int y, int width,
- uint64_t *buffer)
-{
- uint32_t *bits, *alpha_bits;
- int32_t stride, astride;
- int ax, ay;
- storeProc64 store;
- storeProc64 astore;
- const pixman_indexed_t * indexed = pict->indexed;
- const pixman_indexed_t * aindexed;
-
- store = ACCESS(pixman_storeProcForPicture64)(pict);
- astore = ACCESS(pixman_storeProcForPicture64)(pict->common.alpha_map);
- aindexed = pict->common.alpha_map->indexed;
-
- ax = x;
- ay = y;
-
- bits = pict->bits;
- stride = pict->rowstride;
-
- alpha_bits = pict->common.alpha_map->bits;
- astride = pict->common.alpha_map->rowstride;
-
- bits += y*stride;
- alpha_bits += (ay - pict->common.alpha_origin.y)*astride;
-
-
- store((pixman_image_t *)pict, bits, buffer, x, width, indexed);
- astore((pixman_image_t *)pict->common.alpha_map,
- alpha_bits, buffer, ax - pict->common.alpha_origin.x, width, aindexed);
-}