summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2010-11-02 17:02:01 +0100
committerSøren Sandmann Pedersen <ssp@redhat.com>2011-01-19 08:09:06 -0500
commit724f5e67b35420119222a4692d1fe9f4c8f49ba2 (patch)
tree85876f2d3d0d8b1776e096feee29b7862bac8a91
parente6ec404781b0cc34fe07823e419595821ae0ad1c (diff)
downloadpixman-724f5e67b35420119222a4692d1fe9f4c8f49ba2.tar.gz
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).
-rw-r--r--pixman/pixman-image.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index fabcd63..c646471 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -430,10 +430,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;