From a4d1c9d3831751008db61a48d6a6cb12ed33f314 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Tue, 28 Sep 2010 00:42:25 -0400 Subject: [PATCH] Fix bug in FAST_PATH_STD_FAST_PATH The standard fast paths deal with two kinds of images: solids and bits. These two image types require different flags, but PIXMAN_STD_FAST_PATH uses the same ones for both. This patch makes it so that solid images just get the standard flags, while bits images must be untransformed contain the destination clip within the sample grid. This means that the old FAST_PATH_COVERS_CLIP flag is now not used anymore, so it can be deleted. --- pixman/pixman-image.c | 11 +++------- pixman/pixman-private.h | 55 ++++++++++++++++++++++--------------------------- pixman/pixman.c | 4 ++-- 3 files changed, 30 insertions(+), 40 deletions(-) diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index 8397f6a..9802d8c 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -363,24 +363,21 @@ compute_image_info (pixman_image_t *image) flags |= FAST_PATH_NO_PAD_REPEAT | FAST_PATH_NO_NONE_REPEAT | - FAST_PATH_NO_NORMAL_REPEAT | - FAST_PATH_COVERS_CLIP; + FAST_PATH_NO_NORMAL_REPEAT; break; case PIXMAN_REPEAT_PAD: flags |= FAST_PATH_NO_REFLECT_REPEAT | FAST_PATH_NO_NONE_REPEAT | - FAST_PATH_NO_NORMAL_REPEAT | - FAST_PATH_COVERS_CLIP; + FAST_PATH_NO_NORMAL_REPEAT; break; default: flags |= FAST_PATH_NO_REFLECT_REPEAT | FAST_PATH_NO_PAD_REPEAT | - FAST_PATH_NO_NONE_REPEAT | - FAST_PATH_COVERS_CLIP; + FAST_PATH_NO_NONE_REPEAT; break; } @@ -400,8 +397,6 @@ compute_image_info (pixman_image_t *image) if (image->solid.color.alpha == 0xffff) flags |= FAST_PATH_IS_OPAQUE; - - flags |= FAST_PATH_COVERS_CLIP; break; case BITS: diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index d85868f..59d9c5d 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -554,9 +554,9 @@ _pixman_choose_implementation (void); #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_NARROW_FORMAT (1 << 6) -#define FAST_PATH_COVERS_CLIP (1 << 7) +#define FAST_PATH_NARROW_FORMAT (1 << 6) #define FAST_PATH_COMPONENT_ALPHA (1 << 8) +#define FAST_PATH_SAMPLES_OPAQUE (1 << 7) #define FAST_PATH_UNIFIED_ALPHA (1 << 9) #define FAST_PATH_SCALE_TRANSFORM (1 << 10) #define FAST_PATH_NEAREST_FILTER (1 << 11) @@ -571,7 +571,6 @@ _pixman_choose_implementation (void); #define FAST_PATH_BILINEAR_FILTER (1 << 20) #define FAST_PATH_NO_NORMAL_REPEAT (1 << 21) #define FAST_PATH_HAS_TRANSFORM (1 << 22) -#define FAST_PATH_SAMPLES_OPAQUE (1 << 23) #define FAST_PATH_PAD_REPEAT \ (FAST_PATH_NO_NONE_REPEAT | \ @@ -593,29 +592,25 @@ _pixman_choose_implementation (void); FAST_PATH_NO_NORMAL_REPEAT | \ FAST_PATH_NO_PAD_REPEAT) -#define _FAST_PATH_STANDARD_FLAGS \ - (FAST_PATH_ID_TRANSFORM | \ - FAST_PATH_NO_ALPHA_MAP | \ - FAST_PATH_NO_CONVOLUTION_FILTER | \ - FAST_PATH_NO_PAD_REPEAT | \ - FAST_PATH_NO_REFLECT_REPEAT | \ +#define FAST_PATH_STANDARD_FLAGS \ + (FAST_PATH_NO_CONVOLUTION_FILTER | \ FAST_PATH_NO_ACCESSORS | \ - FAST_PATH_NARROW_FORMAT | \ - FAST_PATH_COVERS_CLIP) - -#define FAST_PATH_STD_SRC_FLAGS \ - _FAST_PATH_STANDARD_FLAGS -#define FAST_PATH_STD_MASK_U_FLAGS \ - (_FAST_PATH_STANDARD_FLAGS | \ - FAST_PATH_UNIFIED_ALPHA) -#define FAST_PATH_STD_MASK_CA_FLAGS \ - (_FAST_PATH_STANDARD_FLAGS | \ - FAST_PATH_COMPONENT_ALPHA) + FAST_PATH_NO_ALPHA_MAP | \ + FAST_PATH_NARROW_FORMAT) + #define FAST_PATH_STD_DEST_FLAGS \ (FAST_PATH_NO_ACCESSORS | \ FAST_PATH_NO_ALPHA_MAP | \ FAST_PATH_NARROW_FORMAT) +#define SOURCE_FLAGS(format) \ + (FAST_PATH_STANDARD_FLAGS | \ + ((PIXMAN_ ## format == PIXMAN_solid) ? \ + 0 : (FAST_PATH_SAMPLES_COVER_CLIP | FAST_PATH_ID_TRANSFORM))) + +#define MASK_FLAGS(format, extra) \ + ((PIXMAN_ ## format == PIXMAN_null) ? 0 : (SOURCE_FLAGS (format) | extra)) + #define FAST_PATH(op, src, src_flags, mask, mask_flags, dest, dest_flags, func) \ PIXMAN_OP_ ## op, \ PIXMAN_ ## src, \ @@ -628,19 +623,19 @@ _pixman_choose_implementation (void); #define PIXMAN_STD_FAST_PATH(op, src, mask, dest, func) \ { FAST_PATH ( \ - op, \ - src, FAST_PATH_STD_SRC_FLAGS, \ - mask, (PIXMAN_ ## mask) ? FAST_PATH_STD_MASK_U_FLAGS : 0, \ - dest, FAST_PATH_STD_DEST_FLAGS, \ - func) } + op, \ + src, SOURCE_FLAGS (src), \ + mask, MASK_FLAGS (mask, FAST_PATH_UNIFIED_ALPHA), \ + dest, FAST_PATH_STD_DEST_FLAGS, \ + func) } #define PIXMAN_STD_FAST_PATH_CA(op, src, mask, dest, func) \ { FAST_PATH ( \ - op, \ - src, FAST_PATH_STD_SRC_FLAGS, \ - mask, FAST_PATH_STD_MASK_CA_FLAGS, \ - dest, FAST_PATH_STD_DEST_FLAGS, \ - func) } + op, \ + src, SOURCE_FLAGS (src), \ + mask, MASK_FLAGS (mask, FAST_PATH_COMPONENT_ALPHA), \ + dest, FAST_PATH_STD_DEST_FLAGS, \ + func) } /* Memory allocation helpers */ void * diff --git a/pixman/pixman.c b/pixman/pixman.c index bd9305b..15e7fbf 100644 --- a/pixman/pixman.c +++ b/pixman/pixman.c @@ -746,7 +746,7 @@ analyze_extent (pixman_image_t *image, int x, int y, extents->x2 - x <= image->bits.width && extents->y2 - y <= image->bits.height) { - *flags |= (FAST_PATH_SAMPLES_COVER_CLIP | FAST_PATH_COVERS_CLIP); + *flags |= FAST_PATH_SAMPLES_COVER_CLIP; return TRUE; } @@ -789,7 +789,7 @@ analyze_extent (pixman_image_t *image, int x, int y, ex.x1 >= 0 && ex.y1 >= 0 && ex.x2 <= image->bits.width && ex.y2 <= image->bits.height) { - *flags |= (FAST_PATH_SAMPLES_COVER_CLIP | FAST_PATH_COVERS_CLIP); + *flags |= FAST_PATH_SAMPLES_COVER_CLIP; } } else -- 2.7.4