[Pixman] [PATCH 2/3] Fix opacity check

Andrea Canciani ranma42 at gmail.com
Tue Nov 2 12:05:34 PDT 2010


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 |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index fc0677d..ec277c6 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -436,6 +436,12 @@ compute_image_info (pixman_image_t *image)
 	{
 	    int i;
 
+	    if (image->common.type == RADIAL &&
+		image->radial.a >= 0)
+	    {
+		break;
+	    }
+
 	    flags |= FAST_PATH_IS_OPAQUE;
 	    for (i = 0; i < image->gradient.n_stops; ++i)
 	    {
-- 
1.7.1



More information about the Pixman mailing list