Initial commit
[xorg_rtime.git] / xorg-server-1.4 / hw / xfree86 / xf4bpp / ppcPolyPnt.c
blob1d6905563069de0175f0d5b28704b3de77d87508
1 /*
3 Copyright (c) 1987 X Consortium
5 Permission is hereby granted, free of charge, to any person obtaining
6 a copy of this software and associated documentation files (the
7 "Software"), to deal in the Software without restriction, including
8 without limitation the rights to use, copy, modify, merge, publish,
9 distribute, sublicense, and/or sell copies of the Software, and to
10 permit persons to whom the Software is furnished to do so, subject to
11 the following conditions:
13 The above copyright notice and this permission notice shall be included
14 in all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 OTHER DEALINGS IN THE SOFTWARE.
24 Except as contained in this notice, the name of the X Consortium shall
25 not be used in advertising or otherwise to promote the sale, use or
26 other dealings in this Software without prior written authorization
27 from the X Consortium.
30 Copyright IBM Corporation 1987,1988,1989
31 All Rights Reserved
33 Permission to use, copy, modify, and distribute this software and its
34 documentation for any purpose and without fee is hereby granted,
35 provided that the above copyright notice appear in all copies and that
36 both that copyright notice and this permission notice appear in
37 supporting documentation, and that the name of IBM not be
38 used in advertising or publicity pertaining to distribution of the
39 software without specific, written prior permission.
41 IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
42 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
43 IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
44 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
45 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
46 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
47 SOFTWARE.
50 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
51 All Rights Reserved
53 Permission to use, copy, modify, and distribute this software and its
54 documentation for any purpose and without fee is hereby granted,
55 provided that the above copyright notice appear in all copies and that
56 both that copyright notice and this permission notice appear in
57 supporting documentation, and that the name of Digital not be
58 used in advertising or publicity pertaining to distribution of the
59 software without specific, written prior permission.
61 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
62 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
63 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
64 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
65 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
66 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
67 SOFTWARE.
71 #ifdef HAVE_XORG_CONFIG_H
72 #include <xorg-config.h>
73 #endif
75 #include "xf4bpp.h"
76 #include "mfbmap.h"
77 #include "mfb.h"
78 #include "mi.h"
79 #include "scrnintstr.h"
80 #include "ppcGCstr.h"
81 #include "ibmTrace.h"
83 void
84 xf4bppPolyPoint( pDrawable, pGC, mode, npt, pptInit )
85 DrawablePtr pDrawable ;
86 GCPtr pGC ;
87 int mode ; /* Origin or Previous */
88 int npt ;
89 xPoint *pptInit ;
91 register xPoint *ppt ;
92 ppcPrivGC *devPriv ;
93 int alu ;
94 int nptTmp ;
96 TRACE( ("xf4bppPolyPoint(0x%x,0x%x,%d,%d,0x%x)\n",
97 pDrawable, pGC, mode, npt, pptInit ) ) ;
99 if ( pDrawable->type == DRAWABLE_PIXMAP ) {
100 if ( pGC->alu != GXnoop )
101 miPolyPoint( pDrawable, pGC, mode, npt, pptInit ) ;
102 return ;
105 devPriv = (ppcPrivGC *) ( pGC->devPrivates[mfbGetGCPrivateIndex()].ptr ) ;
106 if ( ( alu = devPriv->colorRrop.alu ) == GXnoop )
107 return ;
109 /* make pointlist origin relative */
110 if ( mode == CoordModePrevious )
111 for ( ppt = pptInit, nptTmp = npt ; --nptTmp ; ) {
112 ppt++ ;
113 ppt->x += (ppt-1)->x ;
114 ppt->y += (ppt-1)->y ;
117 if ( pGC->miTranslate ) {
118 register int xorg = pDrawable->x ;
119 register int yorg = pDrawable->y ;
120 for ( ppt = pptInit, nptTmp = npt ; nptTmp-- ; ppt++ ) {
121 ppt->x += xorg ;
122 ppt->y += yorg ;
127 register RegionPtr pRegion = pGC->pCompositeClip ;
128 register unsigned long int fg = devPriv->colorRrop.fgPixel ;
129 register unsigned long int pm = devPriv->colorRrop.planemask ;
130 BoxRec box ; /* Scratch Space */
132 if ( ! REGION_NUM_RECTS(pRegion))
133 return ;
135 for ( ppt = pptInit ; npt-- ; ppt++ )
136 if (POINT_IN_REGION(pDrawable->pScreen, pRegion,
137 ppt->x, ppt->y, &box))
138 xf4bppFillSolid( (WindowPtr)pDrawable,
139 fg, alu, pm, ppt->x, ppt->y, 1, 1 ) ;
142 return ;