diff options
Diffstat (limited to 'Xprint/pcl/PclSpans.c')
-rw-r--r-- | Xprint/pcl/PclSpans.c | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/Xprint/pcl/PclSpans.c b/Xprint/pcl/PclSpans.c index 38d1b7b01..98c17dcf9 100644 --- a/Xprint/pcl/PclSpans.c +++ b/Xprint/pcl/PclSpans.c @@ -11,7 +11,7 @@ ** * Created: 10/23/95 ** * ** ********************************************************* -** +** ********************************************************************/ /* (c) Copyright 1996 Hewlett-Packard Company @@ -44,6 +44,7 @@ not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from said copyright holders. */ +/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclSpans.c,v 1.6 2001/01/17 22:36:30 dawes Exp $ */ #include "Pcl.h" @@ -51,33 +52,33 @@ copyright holders. #include "windowstr.h" void -PclFillSpans( pDrawable, pGC, nSpans, pPoints, pWidths, fSorted ) - DrawablePtr pDrawable; - GCPtr pGC; - int nSpans; - DDXPointPtr pPoints; - int *pWidths; - int fSorted; +PclFillSpans( + DrawablePtr pDrawable, + GCPtr pGC, + int nSpans, + DDXPointPtr pPoints, + int *pWidths, + int fSorted) { char t[80]; FILE *outFile; int xoffset, yoffset; xRectangle *rects, *r; - RegionPtr fillRegion, region; + RegionPtr fillRegion, region = 0; int i; int nbox; BoxPtr pbox; - + if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE ) return; - + /* * Build a region out of the spans */ rects = (xRectangle *)xalloc( nSpans * sizeof( xRectangle ) ); xoffset = pDrawable->x; yoffset = pDrawable->y; - + for( i = 0, r = rects; i < nSpans; i++, r++ ) { r->x = pPoints[i].x + xoffset; @@ -85,15 +86,15 @@ PclFillSpans( pDrawable, pGC, nSpans, pPoints, pWidths, fSorted ) r->width = pWidths[i]; r->height = 1; } - fillRegion = miRectsToRegion( nSpans, rects, ( fSorted ) ? + fillRegion = RECTS_TO_REGION( pGC->pScreen, nSpans, rects, ( fSorted ) ? CT_YSORTED : CT_UNSORTED ); - + /* * Intersect this region with the clip region. Whatever's left, * should be filled. */ - miIntersect( region, fillRegion, pGC->clientClip ); - + REGION_INTERSECT( pGC->pScreen, region, fillRegion, pGC->clientClip ); + pbox = REGION_RECTS( region ); nbox = REGION_NUM_RECTS( region ); @@ -102,35 +103,33 @@ PclFillSpans( pDrawable, pGC, nSpans, pPoints, pWidths, fSorted ) while( nbox ) { - sprintf( t, "PU%d,%d;RR%d,%d;", pbox->x1, pbox->y1, + sprintf( t, "PU%d,%d;RR%d,%d;", pbox->x1, pbox->y1, pbox->x2, pbox->y2 ); SEND_PCL( outFile, t ); - + nbox--; pbox++; } /* Go back to PCL */ SEND_PCL( outFile, "\27%0A" ); - + /* * Clean up the temporary regions */ - miRegionDestroy( fillRegion ); - miRegionDestroy( region ); + REGION_DESTROY( pGC->pScreen, fillRegion ); + REGION_DESTROY( pGC->pScreen, region ); xfree( rects ); } void -PclSetSpans( pDrawable, pGC, pSrc, pPoints, pWidths, nSpans, fSorted ) - DrawablePtr pDrawable; - GCPtr pGC; - char *pSrc; - DDXPointPtr pPoints; - int *pWidths; - int nSpans; - int fSorted; +PclSetSpans( + DrawablePtr pDrawable, + GCPtr pGC, + char *pSrc, + DDXPointPtr pPoints, + int *pWidths, + int nSpans, + int fSorted) { } - - |