aboutsummaryrefslogtreecommitdiff
path: root/pixman/pixman/pixman-general.c
diff options
context:
space:
mode:
Diffstat (limited to 'pixman/pixman/pixman-general.c')
-rw-r--r--pixman/pixman/pixman-general.c54
1 files changed, 25 insertions, 29 deletions
diff --git a/pixman/pixman/pixman-general.c b/pixman/pixman/pixman-general.c
index fa22049df..105125359 100644
--- a/pixman/pixman/pixman-general.c
+++ b/pixman/pixman/pixman-general.c
@@ -57,17 +57,6 @@ general_composite_rect (pixman_implementation_t *imp,
int32_t height)
{
uint8_t stack_scanline_buffer[SCANLINE_BUFFER_LENGTH * 3];
- const pixman_format_code_t src_format =
- src->type == BITS ? src->bits.format : 0;
- const pixman_format_code_t mask_format =
- mask && mask->type == BITS ? mask->bits.format : 0;
- const pixman_format_code_t dest_format =
- dest->type == BITS ? dest->bits.format : 0;
- const int src_wide = PIXMAN_FORMAT_IS_WIDE (src_format);
- const int mask_wide = mask && PIXMAN_FORMAT_IS_WIDE (mask_format);
- const int dest_wide = PIXMAN_FORMAT_IS_WIDE (dest_format);
- const int wide = src_wide || mask_wide || dest_wide;
- const int Bpp = wide ? 8 : 4;
uint8_t *scanline_buffer = stack_scanline_buffer;
uint8_t *src_buffer, *mask_buffer, *dest_buffer;
fetch_scanline_t fetch_src = NULL, fetch_mask = NULL, fetch_dest = NULL;
@@ -77,8 +66,15 @@ general_composite_rect (pixman_implementation_t *imp,
pixman_bool_t component_alpha;
uint32_t *bits;
int32_t stride;
+ int narrow, Bpp;
int i;
+ narrow =
+ (src->common.flags & FAST_PATH_NARROW_FORMAT) &&
+ (!mask || mask->common.flags & FAST_PATH_NARROW_FORMAT) &&
+ (dest->common.flags & FAST_PATH_NARROW_FORMAT);
+ Bpp = narrow ? 4 : 8;
+
if (width * Bpp > SCANLINE_BUFFER_LENGTH)
{
scanline_buffer = pixman_malloc_abc (width, 3, Bpp);
@@ -106,29 +102,29 @@ general_composite_rect (pixman_implementation_t *imp,
if (op == PIXMAN_OP_CLEAR)
fetch_src = NULL;
- else if (wide)
- fetch_src = _pixman_image_get_scanline_64;
- else
+ else if (narrow)
fetch_src = _pixman_image_get_scanline_32;
+ else
+ fetch_src = _pixman_image_get_scanline_64;
if (!mask || op == PIXMAN_OP_CLEAR)
fetch_mask = NULL;
- else if (wide)
- fetch_mask = _pixman_image_get_scanline_64;
- else
+ else if (narrow)
fetch_mask = _pixman_image_get_scanline_32;
+ else
+ fetch_mask = _pixman_image_get_scanline_64;
if (op == PIXMAN_OP_CLEAR || op == PIXMAN_OP_SRC)
fetch_dest = NULL;
- else if (wide)
- fetch_dest = _pixman_image_get_scanline_64;
- else
+ else if (narrow)
fetch_dest = _pixman_image_get_scanline_32;
-
- if (wide)
- store = _pixman_image_store_scanline_64;
else
+ fetch_dest = _pixman_image_get_scanline_64;
+
+ if (narrow)
store = _pixman_image_store_scanline_32;
+ else
+ store = _pixman_image_store_scanline_64;
/* Skip the store step and composite directly into the
* destination if the output format of the compose func matches
@@ -148,7 +144,7 @@ general_composite_rect (pixman_implementation_t *imp,
op == PIXMAN_OP_OUT_REVERSE ||
op == PIXMAN_OP_DST)))
{
- if (!wide &&
+ if (narrow &&
!dest->common.alpha_map &&
!dest->bits.write_func)
{
@@ -175,19 +171,19 @@ general_composite_rect (pixman_implementation_t *imp,
mask->common.component_alpha &&
PIXMAN_FORMAT_RGB (mask->bits.format);
- if (wide)
+ if (narrow)
{
if (component_alpha)
- compose = (pixman_combine_32_func_t)_pixman_implementation_combine_64_ca;
+ compose = _pixman_implementation_combine_32_ca;
else
- compose = (pixman_combine_32_func_t)_pixman_implementation_combine_64;
+ compose = _pixman_implementation_combine_32;
}
else
{
if (component_alpha)
- compose = _pixman_implementation_combine_32_ca;
+ compose = (pixman_combine_32_func_t)_pixman_implementation_combine_64_ca;
else
- compose = _pixman_implementation_combine_32;
+ compose = (pixman_combine_32_func_t)_pixman_implementation_combine_64;
}
if (!compose)