Re: [PATCH] Delete RegionClipSpans()

2011-02-28 Thread Adam Jackson

On 2/26/11 2:07 PM, Søren Sandmann wrote:

From: Søren Sandmann Pedersen

Nothing uses it.

Signed-off-by: Soren Sandmann


Reviewed-by: Adam Jackson 

and merged to xserver-next:

http://cgit.freedesktop.org/~ajax/xserver/log/?h=xserver-next

I'll be using that branch to stage small patches from the list for 
merging to master, hopefully we can get better at not dropping fixes on 
the floor.


- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH] Delete RegionClipSpans()

2011-02-26 Thread Søren Sandmann
From: Søren Sandmann Pedersen 

Nothing uses it.

Signed-off-by: Soren Sandmann 
---
 dix/region.c|  234 ---
 include/regionstr.h |   10 --
 2 files changed, 0 insertions(+), 244 deletions(-)

diff --git a/dix/region.c b/dix/region.c
index 5ba3457..6820c1e 100644
--- a/dix/region.c
+++ b/dix/region.c
@@ -1423,237 +1423,3 @@ RegionFromRects(int nrects, xRectangle *prect, int 
ctype)
 }
 return pRgn;
 }
-
-#define ExchangeSpans(a, b)\
-{  \
-DDXPointRectpt;\
-inttw; \
-   \
-tpt = spans[a]; spans[a] = spans[b]; spans[b] = tpt;\
-tw = widths[a]; widths[a] = widths[b]; widths[b] = tw;  \
-}
-
-/* ||| I should apply the merge sort code to rectangle sorting above, and see
-   if mapping time can be improved.  But right now I've been at work 12 hours,
-   so forget it.
-*/
-
-static void QuickSortSpans(
-DDXPointRec spans[],
-intwidths[],
-intnumSpans)
-{
-inty;
-inti, j, m;
-DDXPointPtrr;
-
-/* Always called with numSpans > 1 */
-/* Sorts only by y, doesn't bother to sort by x */
-
-do
-{
-   if (numSpans < 9)
-   {
-   /* Do insertion sort */
-   int yprev;
-
-   yprev = spans[0].y;
-   i = 1;
-   do
-   { /* while i != numSpans */
-   y = spans[i].y;
-   if (yprev > y)
-   {
-   /* spans[i] is out of order.  Move into proper location. */
-   DDXPointRec tpt;
-   int tw, k;
-
-   for (j = 0; y >= spans[j].y; j++) {}
-   tpt = spans[i];
-   tw  = widths[i];
-   for (k = i; k != j; k--)
-   {
-   spans[k] = spans[k-1];
-   widths[k] = widths[k-1];
-   }
-   spans[j] = tpt;
-   widths[j] = tw;
-   y = spans[i].y;
-   } /* if out of order */
-   yprev = y;
-   i++;
-   } while (i != numSpans);
-   return;
-   }
-
-   /* Choose partition element, stick in location 0 */
-   m = numSpans / 2;
-   if (spans[m].y > spans[0].y)ExchangeSpans(m, 0);
-   if (spans[m].y > spans[numSpans-1].y)   ExchangeSpans(m, numSpans-1);
-   if (spans[m].y > spans[0].y)ExchangeSpans(m, 0);
-   y = spans[0].y;
-
-/* Partition array */
-i = 0;
-j = numSpans;
-do
-   {
-   r = &(spans[i]);
-   do
-   {
-   r++;
-   i++;
-} while (i != numSpans && r->y < y);
-   r = &(spans[j]);
-   do
-   {
-   r--;
-   j--;
-} while (y < r->y);
-if (i < j)
-   ExchangeSpans(i, j);
-} while (i < j);
-
-/* Move partition element back to middle */
-ExchangeSpans(0, j);
-
-   /* Recurse */
-if (numSpans-j-1 > 1)
-   QuickSortSpans(&spans[j+1], &widths[j+1], numSpans-j-1);
-numSpans = j;
-} while (numSpans > 1);
-}
-
-#define NextBand() \
-{  \
-clipy1 = pboxBandStart->y1;\
-clipy2 = pboxBandStart->y2;\
-pboxBandEnd = pboxBandStart + 1;   \
-while (pboxBandEnd != pboxLast && pboxBandEnd->y1 == clipy1) {  \
-   pboxBandEnd++;  \
-}  \
-for (; ppt != pptLast && ppt->y < clipy1; ppt++, pwidth++) {} \
-}
-
-/*
-Clip a list of scanlines to a region.  The caller has allocated the
-space.  FSorted is non-zero if the scanline origins are in ascending
-order.
-returns the number of new, clipped scanlines.
-*/
-
-int
-RegionClipSpans(
-RegionPtr  prgnDst,
-DDXPointPtr ppt,
-int*pwidth,
-intnspans,
-DDXPointPtrpptNew,
-int*pwidthNew,
-intfSorted)
-{
-DDXPointPtr pptLast;
-int*pwidthNewStart;/* the vengeance of Xerox! */
-inty, x1, x2;
-intnumRects;
-
-good(prgnDst);
-pptLast = ppt + nspans;
-pwidthNewStart = pwidthNew;
-
-if (!prgnDst->data)
-{
-   /* Do special fast code with clip boundaries in registers(?) */
-   /* It doesn't pay much to make use of fSorted