From 151f2554fc9c098ff86b0fdc0d785aa3ff496328 Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Tue, 2 Nov 2010 17:02:01 +0100 Subject: [PATCH] Fix opacity check Radial gradients are "conical", thus they can have some non-opaque parts even if all of their stops are completely opaque. To guarantee that a radial gradient is actually opaque, it needs to also have one of the two circles containing the other one. In this case when extrapolating, the whole plane is completely covered (as explained in the comment in pixman-radial-gradient.c). --- pixman/pixman-image.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index c9420c3..e78b139 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -398,10 +398,24 @@ compute_image_info (pixman_image_t *image) flags &= ~FAST_PATH_NARROW_FORMAT; break; - case LINEAR: case RADIAL: code = PIXMAN_unknown; + /* + * As explained in pixman-radial-gradient.c, every point of + * the plane has a valid associated radius (and thus will be + * colored) if and only if a is negative (i.e. one of the two + * circles contains the other one). + */ + + if (image->radial.a >= 0) + break; + + /* Fall through */ + + case LINEAR: + code = PIXMAN_unknown; + if (image->common.repeat != PIXMAN_REPEAT_NONE) { int i; -- 2.7.4