2 * Copyright IBM Corporation 1987,1988,1989
6 * Permission to use, copy, modify, and distribute this software and its
7 * documentation for any purpose and without fee is hereby granted,
8 * provided that the above copyright notice appear in all copies and that
9 * both that copyright notice and this permission notice appear in
10 * supporting documentation, and that the name of IBM not be
11 * used in advertising or publicity pertaining to distribution of the
12 * software without specific, written prior permission.
14 * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16 * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
24 /***********************************************************
26 Copyright (c) 1987 X Consortium
28 Permission is hereby granted, free of charge, to any person obtaining a copy
29 of this software and associated documentation files (the "Software"), to deal
30 in the Software without restriction, including without limitation the rights
31 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
32 copies of the Software, and to permit persons to whom the Software is
33 furnished to do so, subject to the following conditions:
35 The above copyright notice and this permission notice shall be included in
36 all copies or substantial portions of the Software.
38 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
42 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
43 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45 Except as contained in this notice, the name of the X Consortium shall not be
46 used in advertising or otherwise to promote the sale, use or other dealings
47 in this Software without prior written authorization from the X Consortium.
50 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
54 Permission to use, copy, modify, and distribute this software and its
55 documentation for any purpose and without fee is hereby granted,
56 provided that the above copyright notice appear in all copies and that
57 both that copyright notice and this permission notice appear in
58 supporting documentation, and that the name of Digital not be
59 used in advertising or publicity pertaining to distribution of the
60 software without specific, written prior permission.
62 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
63 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
64 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
65 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
66 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
67 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
70 ******************************************************************/
72 #ifdef HAVE_XORG_CONFIG_H
73 #include <xorg-config.h>
80 #include "scrnintstr.h"
83 /* NOTE: These functions only work for visuals up to 31-bits deep */
84 static void xf4bppPaintWindowSolid(
89 static void xf4bppPaintWindowTile(
96 xf4bppPaintWindow(pWin
, pRegion
, what
)
102 register mfbPrivWin
*pPrivWin
;
103 pPrivWin
= (mfbPrivWin
*)(pWin
->devPrivates
[mfbGetWindowPrivateIndex()].ptr
);
105 TRACE(("xf4bppPaintWindow( pWin= 0x%x, pRegion= 0x%x, what= %d )\n",
110 switch (pWin
->backgroundState
) {
116 } while (pWin
->backgroundState
== ParentRelative
);
117 (*pWin
->drawable
.pScreen
->PaintWindowBackground
)(pWin
, pRegion
,
120 case BackgroundPixmap
:
121 if (pPrivWin
->fastBackground
)
123 xf4bppPaintWindowTile(pWin
, pRegion
, what
);
127 case BackgroundPixel
:
128 xf4bppPaintWindowSolid(pWin
, pRegion
, what
);
133 if (pWin
->borderIsPixel
)
135 xf4bppPaintWindowSolid(pWin
, pRegion
, what
);
138 else if (pPrivWin
->fastBorder
)
140 xf4bppPaintWindowTile(pWin
, pRegion
, what
);
145 miPaintWindow(pWin
, pRegion
, what
);
149 xf4bppPaintWindowSolid(pWin
, pRegion
, what
)
150 register WindowPtr pWin
;
151 register RegionPtr pRegion
;
155 register BoxPtr pbox
;
156 register unsigned long int pixel
;
157 register unsigned long int pm
;
159 TRACE(("xf4bppPaintWindowSolid(pWin= 0x%x, pRegion= 0x%x, what= %d)\n", pWin
, pRegion
, what
));
161 if ( !( nbox
= REGION_NUM_RECTS(pRegion
)))
163 pbox
= REGION_RECTS(pRegion
);
165 if (what
== PW_BACKGROUND
)
166 pixel
= pWin
->background
.pixel
;
168 pixel
= pWin
->border
.pixel
;
170 pm
= ( 1 << pWin
->drawable
.depth
) - 1 ;
171 for ( ; nbox
-- ; pbox
++ ) {
173 * call fill routine, the parms are:
174 * fill(color, alu, planes, x, y, width, height);
176 xf4bppFillSolid( pWin
, pixel
, GXcopy
, pm
, pbox
->x1
, pbox
->y1
,
177 pbox
->x2
- pbox
->x1
, pbox
->y2
- pbox
->y1
) ;
183 xf4bppPaintWindowTile(pWin
, pRegion
, what
)
184 register WindowPtr pWin
;
185 register RegionPtr pRegion
;
189 register BoxPtr pbox
;
190 register PixmapPtr pTile
;
191 register unsigned long int pm
;
193 TRACE(("xf4bppPaintWindowTile(pWin= 0x%x, pRegion= 0x%x, what= %d)\n", pWin
, pRegion
, what
));
195 if ( !( nbox
= REGION_NUM_RECTS(pRegion
)))
197 pbox
= REGION_RECTS(pRegion
);
199 if (what
== PW_BACKGROUND
)
200 pTile
= pWin
->background
.pixmap
;
202 pTile
= pWin
->border
.pixmap
;
204 pm
= ( 1 << pWin
->drawable
.depth
) - 1 ;
205 for ( ; nbox
-- ; pbox
++ ) {
207 * call tile routine, the parms are:
208 * tile(tile, alu, planes, x, y, width, height,xSrc,ySrc);
210 xf4bppTileRect(pWin
, pTile
, GXcopy
, pm
,
212 pbox
->x2
- pbox
->x1
, pbox
->y2
- pbox
->y1
,
213 pWin
->drawable
.x
, pWin
->drawable
.y
);