summaryrefslogtreecommitdiff
path: root/libre/xorg-server/0001-mi-Partial-pie-slice-filled-arcs-may-need-more-space.patch
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-04-14 17:56:10 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-04-14 18:41:58 -0300
commit715a30c86707c51c15e97384c775a914548ad79e (patch)
treecc9f14c0ed8828574ac93a498081a60e61c19a1d /libre/xorg-server/0001-mi-Partial-pie-slice-filled-arcs-may-need-more-space.patch
parent84ad1ed513cc7a237ebb343cf364525966617554 (diff)
xorg-server-1.17.1-5.parabola1: fix FS#43937 -> https://bugs.archlinux.org/task/43937
Diffstat (limited to 'libre/xorg-server/0001-mi-Partial-pie-slice-filled-arcs-may-need-more-space.patch')
-rw-r--r--libre/xorg-server/0001-mi-Partial-pie-slice-filled-arcs-may-need-more-space.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/libre/xorg-server/0001-mi-Partial-pie-slice-filled-arcs-may-need-more-space.patch b/libre/xorg-server/0001-mi-Partial-pie-slice-filled-arcs-may-need-more-space.patch
new file mode 100644
index 000000000..668ae21ba
--- /dev/null
+++ b/libre/xorg-server/0001-mi-Partial-pie-slice-filled-arcs-may-need-more-space.patch
@@ -0,0 +1,42 @@
+From 41932dfbc841a1adc6512d41085ea3f8ebecb42c Mon Sep 17 00:00:00 2001
+From: Keith Packard <keithp@keithp.com>
+Date: Wed, 8 Apr 2015 07:45:28 -0700
+Subject: [PATCH] mi: Partial pie-slice filled arcs may need more space for
+ spans
+
+The mi filled arc code estimates that a filled arc will produce no
+more spans than the arc is tall. This is true for most arcs except
+for pie-slice arcs strictly between 180 and 360 degrees where the missing
+portion of the arc faces up or down such that we get two spans on some
+scanlines.
+
+For those, we need to reserve room for another height/2 spans. This
+patch just does it for all partial pie-sliced arcs to make the test
+easier to understand; it's just over-allocating a bit of memory, so
+that's safe.
+
+Signed-off-by: Keith Packard <keithp@keithp.com>
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+---
+ mi/mifillarc.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/mi/mifillarc.c b/mi/mifillarc.c
+index 246d70f..888519e 100644
+--- a/mi/mifillarc.c
++++ b/mi/mifillarc.c
+@@ -660,6 +660,11 @@ miPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs_all, xArc * parcs)
+ if (narcs && nspans + arc->height > MAX_SPANS_PER_LOOP)
+ break;
+ nspans += arc->height;
++
++ /* A pie-slice arc may add another pile of spans */
++ if (pGC->arcMode == ArcPieSlice &&
++ (-FULLCIRCLE < arc->angle2 && arc->angle2 < FULLCIRCLE))
++ nspans += (arc->height + 1) >> 1;
+ }
+
+ pts = points = malloc (sizeof (DDXPointRec) * nspans +
+--
+2.3.5
+