From a81259e4e865972ad221e2760be3535200c70376 Mon Sep 17 00:00:00 2001
From: Andrea Canciani <ranma42@gmail.com>
Date: Tue, 2 Nov 2010 17:02:01 +0100
Subject: [PATCH 2/3] 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 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index fc0677d..f373107 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -428,10 +428,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;
-- 
1.7.1

