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

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