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;
+ 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;
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
op == PIXMAN_OP_OUT_REVERSE ||
op == PIXMAN_OP_DST)))
{
- if (!wide &&
+ if (narrow &&
!dest->common.alpha_map &&
!dest->bits.write_func)
{
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)
#define FAST_PATH_NO_PAD_REPEAT (1 << 3)
#define FAST_PATH_NO_REFLECT_REPEAT (1 << 4)
#define FAST_PATH_NO_ACCESSORS (1 << 5)
-#define FAST_PATH_NO_WIDE_FORMAT (1 << 6)
+#define FAST_PATH_NARROW_FORMAT (1 << 6)
#define FAST_PATH_COVERS_CLIP (1 << 7)
#define FAST_PATH_COMPONENT_ALPHA (1 << 8)
#define FAST_PATH_UNIFIED_ALPHA (1 << 9)
FAST_PATH_NO_PAD_REPEAT | \
FAST_PATH_NO_REFLECT_REPEAT | \
FAST_PATH_NO_ACCESSORS | \
- FAST_PATH_NO_WIDE_FORMAT | \
+ FAST_PATH_NARROW_FORMAT | \
FAST_PATH_COVERS_CLIP)
#define FAST_PATH_STD_SRC_FLAGS \
#define FAST_PATH_STD_DEST_FLAGS \
(FAST_PATH_NO_ACCESSORS | \
FAST_PATH_NO_ALPHA_MAP | \
- FAST_PATH_NO_WIDE_FORMAT)
+ FAST_PATH_NARROW_FORMAT)
#define FAST_PATH(op, src, src_flags, mask, mask_flags, dest, dest_flags, func) \
PIXMAN_OP_ ## op, \