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_narrow = !PIXMAN_FORMAT_IS_WIDE (src_format);
- const int mask_narrow = !mask || !PIXMAN_FORMAT_IS_WIDE (mask_format);
- const int dest_narrow = !PIXMAN_FORMAT_IS_WIDE (dest_format);
- const int narrow = src_narrow && mask_narrow && dest_narrow;
- const int Bpp = narrow ? 4 : 8;
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;
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);
flags |= FAST_PATH_Y_UNIT_ZERO;
}
- /* Alpha map */
- if (!image->common.alpha_map)
- flags |= FAST_PATH_NO_ALPHA_MAP;
-
/* Filter */
switch (image->common.filter)
{
break;
}
+ /* Alpha map */
+ if (!image->common.alpha_map)
+ {
+ flags |= FAST_PATH_NO_ALPHA_MAP;
+ }
+ else
+ {
+ if (PIXMAN_FORMAT_IS_WIDE (image->common.alpha_map->format))
+ flags &= ~FAST_PATH_NARROW_FORMAT;
+ }
+
/* Both alpha maps and convolution filters can introduce
* non-opaqueness in otherwise opaque images. Also
* an image with component alpha turned on is only opaque