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

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