1
/* $Xorg: PsSpans.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */
4
Copyright 1996, 1998 The Open Group
6
Permission to use, copy, modify, distribute, and sell this software and its
7
documentation for any purpose is hereby granted without fee, provided that
8
the above copyright notice appear in all copies and that both that
9
copyright notice and this permission notice appear in supporting
12
The above copyright notice and this permission notice shall be included in
13
all copies or substantial portions of the Software.
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
Except as contained in this notice, the name of The Open Group shall not be
23
used in advertising or otherwise to promote the sale, use or other dealings
24
in this Software without prior written authorization from The Open Group.
28
* (c) Copyright 1996 Hewlett-Packard Company
29
* (c) Copyright 1996 International Business Machines Corp.
30
* (c) Copyright 1996 Sun Microsystems, Inc.
31
* (c) Copyright 1996 Novell, Inc.
32
* (c) Copyright 1996 Digital Equipment Corp.
33
* (c) Copyright 1996 Fujitsu Limited
34
* (c) Copyright 1996 Hitachi, Ltd.
36
* Permission is hereby granted, free of charge, to any person obtaining
37
* a copy of this software and associated documentation files (the
38
* "Software"), to deal in the Software without restriction, including
39
* without limitation the rights to use, copy, modify, merge, publish,
40
* distribute, sublicense, and/or sell copies of the Software, and to
41
* permit persons to whom the Software is furnished to do so, subject
42
* to the following conditions:
44
* The above copyright notice and this permission notice shall be included
45
* in all copies or substantial portions of the Software.
47
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
50
* THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
51
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
52
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
55
* Except as contained in this notice, the names of the copyright holders
56
* shall not be used in advertising or otherwise to promote the sale, use
57
* or other dealings in this Software without prior written authorization
58
* from said copyright holders.
61
/*******************************************************************
63
** *********************************************************
67
** * Contents: Code to set and fill spans in the PS DDX
69
** * Created By: Roger Helmendach (Liberty Systems)
71
** * Copyright: Copyright 1996 The Open Group, Inc.
73
** *********************************************************
75
********************************************************************/
76
/* $XFree86: xc/programs/Xserver/Xprint/ps/PsSpans.c,v 1.8 2001/10/28 03:32:56 tsi Exp $ */
78
#ifdef HAVE_DIX_CONFIG_H
79
#include <dix-config.h>
84
#include "windowstr.h"
88
DrawablePtr pDrawable,
97
xRectangle *rects, *r;
98
RegionPtr fillRegion, region = 0;
104
if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return;
107
* Build a region out of the spans
109
rects = (xRectangle *)xalloc(nSpans*sizeof(xRectangle));
110
xoffset = pDrawable->x;
111
yoffset = pDrawable->y;
113
for( i = 0, r = rects; i < nSpans; i++, r++ )
115
r->x = pPoints[i].x + xoffset;
116
r->y = pPoints[i].y + yoffset;
117
r->width = pWidths[i];
120
fillRegion = RECTS_TO_REGION(pGC->pScreen, nSpans, rects,
121
(fSorted)?CT_YSORTED:CT_UNSORTED);
124
* Intersect this region with the clip region. Whatever's left,
127
/*REGION_INTERSECT(pGC->pScreen, region, fillRegion, pGC->clientClip);*/
129
pbox = REGION_RECTS(region);
130
nbox = REGION_NUM_RECTS(region);
133
/*###SEND_PCL( outFile, "\27%0B" );*/
138
sprintf( t, "PU%d,%d;RR%d,%d;", pbox->x1, pbox->y1, pbox->x2, pbox->y2);
139
SEND_PCL( outFile, t );
146
/*###SEND_PCL( outFile, "\27%0A" );*/
149
* Clean up the temporary regions
151
REGION_DESTROY(pGC->pScreen, fillRegion);
152
REGION_DESTROY(pGC->pScreen, region);
158
DrawablePtr pDrawable,