From e8a180797c726a8990291158be8db843c26b98d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Mon, 20 May 2013 09:04:22 -0400 Subject: [PATCH] Add ITER_SRC and ITER_DEST iter flags These indicate whether the iterator is for a source or a destination image. Note iterator initializers are allowed to rely on one of these being set, so they can't be left out the way it's generally harmless (aside from potentil performance degradation) to leave out a particular fast path flag. --- pixman/pixman-general.c | 14 +++++++++----- pixman/pixman-image.c | 2 +- pixman/pixman-private.h | 8 +++++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c index 93a1b9a..a4935c7 100644 --- a/pixman/pixman-general.c +++ b/pixman/pixman-general.c @@ -154,7 +154,7 @@ general_composite_rect (pixman_implementation_t *imp, } /* src iter */ - src_iter_flags = narrow | op_flags[op].src; + src_iter_flags = narrow | op_flags[op].src | ITER_SRC; _pixman_implementation_src_iter_init (imp->toplevel, &src_iter, src_image, src_x, src_y, width, height, @@ -177,13 +177,17 @@ general_composite_rect (pixman_implementation_t *imp, PIXMAN_FORMAT_RGB (mask_image->bits.format); _pixman_implementation_src_iter_init ( - imp->toplevel, &mask_iter, mask_image, mask_x, mask_y, width, height, - mask_buffer, narrow | (component_alpha? 0 : ITER_IGNORE_RGB), info->mask_flags); + imp->toplevel, &mask_iter, + mask_image, mask_x, mask_y, width, height, mask_buffer, + ITER_SRC | narrow | (component_alpha? 0 : ITER_IGNORE_RGB), + info->mask_flags); /* dest iter */ _pixman_implementation_dest_iter_init ( - imp->toplevel, &dest_iter, dest_image, dest_x, dest_y, width, height, - dest_buffer, narrow | op_flags[op].dst, info->dest_flags); + imp->toplevel, &dest_iter, + dest_image, dest_x, dest_y, width, height, dest_buffer, + ITER_DEST | narrow | op_flags[op].dst, + info->dest_flags); compose = _pixman_implementation_lookup_combiner ( imp->toplevel, op, component_alpha, narrow); diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index 65041b4..ebf55cd 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -921,7 +921,7 @@ _pixman_image_get_solid (pixman_implementation_t *imp, _pixman_implementation_src_iter_init ( imp, &iter, image, 0, 0, 1, 1, (uint8_t *)&result, - ITER_NARROW, image->common.flags); + ITER_NARROW | ITER_SRC, image->common.flags); result = *iter.get_scanline (&iter, NULL); } diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index 6d9c053..9b6353e 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -231,7 +231,13 @@ typedef enum */ ITER_LOCALIZED_ALPHA = (1 << 1), ITER_IGNORE_ALPHA = (1 << 2), - ITER_IGNORE_RGB = (1 << 3) + ITER_IGNORE_RGB = (1 << 3), + + /* These indicate whether the iterator is for a source + * or a destination image + */ + ITER_SRC = (1 << 4), + ITER_DEST = (1 << 5) } iter_flags_t; struct pixman_iter_t -- 2.7.4