Blame SOURCES/RFC-mi-reduce-missing-segments-on-large-ellipse.patch

a3e08e
From patchwork Thu Apr 16 12:04:21 2015
a3e08e
Content-Type: text/plain; charset="utf-8"
a3e08e
MIME-Version: 1.0
a3e08e
Content-Transfer-Encoding: 7bit
a3e08e
Subject: [RFC] mi: reduce missing segments on large ellipse
a3e08e
From: Olivier Fourdan <ofourdan@redhat.com>
a3e08e
X-Patchwork-Id: 47327
a3e08e
Message-Id: <1429185861-4411-2-git-send-email-ofourdan@redhat.com>
a3e08e
To: xorg-devel@lists.x.org
a3e08e
Cc: Olivier Fourdan <ofourdan@redhat.com>
a3e08e
Date: Thu, 16 Apr 2015 14:04:21 +0200
a3e08e
a3e08e
With larger ellipses, rounding will cause some spans close to vertical
a3e08e
tangent to be of zero length, leading to sometimes rather large missing
a3e08e
portion of the arc.
a3e08e
a3e08e
Try to detect this case and work around it.
a3e08e
a3e08e
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1166989
a3e08e
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91858
a3e08e
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
a3e08e
---
a3e08e
 mi/miarc.c | 10 ++++++++++
a3e08e
 1 file changed, 10 insertions(+)
a3e08e
a3e08e
diff --git a/mi/miarc.c b/mi/miarc.c
a3e08e
index e8bc87e..be9c94c 100644
a3e08e
--- a/mi/miarc.c
a3e08e
+++ b/mi/miarc.c
a3e08e
@@ -563,6 +563,16 @@ miComputeEllipseSpans(int lw, xArc * parc, miArcSpanData * spdata)
a3e08e
                     outx = x + t;
a3e08e
             }
a3e08e
         }
a3e08e
+        if (ICEIL(xorg + outx) - ICEIL(xorg + inx) < lw ) {
a3e08e
+            if (inx <= 0.0) {
a3e08e
+                outx = outx + ICEIL(-r);
a3e08e
+                inx = inx + ICEIL(r);
a3e08e
+	    }
a3e08e
+	    else {
a3e08e
+                outx = outx + ICEIL(r);
a3e08e
+                inx = inx + ICEIL(-r);
a3e08e
+	    }
a3e08e
+        }
a3e08e
         span->lx = ICEIL(xorg - outx);
a3e08e
         if (inx <= 0.0) {
a3e08e
             spdata->count1++;