[PATCH] render: Allow single-stop gradients

Andrea Canciani ranma42 at gmail.com
Wed Jul 27 01:52:31 PDT 2011


The Render specification allows single-stop gradients and pixman 0.22
(which the X server depends on) can rasterize them correctly.

Signed-off-by: Andrea Canciani <ranma42 at gmail.com>
---
 render/picture.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/render/picture.c b/render/picture.c
index 5640c4d..d91b43a 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -886,7 +886,7 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2,
 {
     PicturePtr pPicture;
 
-    if (nStops < 2) {
+    if (nStops < 1) {
         *error = BadValue;
         return 0;
     }
@@ -925,7 +925,7 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer
     PicturePtr pPicture;
     PictRadialGradient *radial;
 
-    if (nStops < 2) {
+    if (nStops < 1) {
         *error = BadValue;
         return 0;
     }
@@ -967,7 +967,7 @@ CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle,
 {
     PicturePtr pPicture;
 
-    if (nStops < 2) {
+    if (nStops < 1) {
         *error = BadValue;
         return 0;
     }
-- 
1.7.1



More information about the xorg-devel mailing list