1 /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
2 /***********************************************************
4 Copyright 1987, 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.
27 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
31 Permission to use, copy, modify, and distribute this software and its
32 documentation for any purpose and without fee is hereby granted,
33 provided that the above copyright notice appear in all copies and that
34 both that copyright notice and this permission notice appear in
35 supporting documentation, and that the name of Digital not be
36 used in advertising or publicity pertaining to distribution of the
37 software without specific, written prior permission.
39 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
40 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
41 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
42 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
43 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
44 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
47 ******************************************************************/
48 #ifdef HAVE_DIX_CONFIG_H
49 #include <dix-config.h>
54 #include "windowstr.h"
55 #include "regionstr.h"
56 #include "pixmapstr.h"
57 #include "scrnintstr.h"
65 the boxes are already translated.
68 iy = ++iy < tileHeight ? iy : 0
69 is equivalent to iy%= tileheight, and saves a division.
73 tile area with a PPW bit wide pixmap
76 MROP_NAME(mfbTileAreaPPW
)(pDraw
, nbox
, pbox
, alu
, ptile
)
83 register PixelType
*psrc
;
84 /* pointer to bits in tile, if needed */
85 int tileHeight
; /* height of the tile */
86 register PixelType srcpix
;
87 int nlwidth
; /* width in longwords of the drawable */
88 int w
; /* width of current box */
90 register int h
; /* height of current box */
91 register int nlw
; /* loop version of nlwMiddle */
92 register PixelType
*p
; /* pointer to bits we're writing */
94 PixelType endmask
; /* masks for reggedy bits at either end of line */
95 int nlwMiddle
; /* number of longwords between sides of boxes */
96 int nlwExtra
; /* to get from right of box to left of next span */
97 register int iy
; /* index of current scanline in tile */
98 PixelType
*pbits
; /* pointer to start of drawable */
100 mfbGetPixelWidthAndPointer(pDraw
, nlwidth
, pbits
);
102 MROP_INITIALIZE(alu
,~0)
104 tileHeight
= ptile
->drawable
.height
;
105 psrc
= (PixelType
*)(ptile
->devPrivate
.ptr
);
109 w
= pbox
->x2
- pbox
->x1
;
110 h
= pbox
->y2
- pbox
->y1
;
111 iy
= pbox
->y1
% tileHeight
;
112 p
= mfbScanline(pbits
, pbox
->x1
, pbox
->y1
, nlwidth
);
114 if ( ((pbox
->x1
& PIM
) + w
) < PPW
)
116 maskpartialbits(pbox
->x1
, w
, startmask
);
122 if (iy
== tileHeight
)
124 *p
= MROP_MASK(srcpix
,*p
,startmask
);
125 mfbScanlineInc(p
, nlwExtra
);
130 maskbits(pbox
->x1
, w
, startmask
, endmask
, nlwMiddle
);
131 nlwExtra
= nlwidth
- nlwMiddle
;
133 if (startmask
&& endmask
)
140 if (iy
== tileHeight
)
143 *p
= MROP_MASK (srcpix
,*p
,startmask
);
147 *p
= MROP_SOLID(srcpix
,*p
);
151 *p
= MROP_MASK(srcpix
,*p
,endmask
);
152 mfbScanlineInc(p
, nlwExtra
);
155 else if (startmask
&& !endmask
)
162 if (iy
== tileHeight
)
165 *p
= MROP_MASK(srcpix
,*p
,startmask
);
169 *p
= MROP_SOLID(srcpix
,*p
);
172 mfbScanlineInc(p
, nlwExtra
);
175 else if (!startmask
&& endmask
)
181 if (iy
== tileHeight
)
186 *p
= MROP_SOLID(srcpix
,*p
);
190 *p
= MROP_MASK(srcpix
,*p
,endmask
);
191 mfbScanlineInc(p
, nlwExtra
);
194 else /* no ragged bits at either end */
200 if (iy
== tileHeight
)
205 *p
= MROP_SOLID (srcpix
,*p
);
208 mfbScanlineInc(p
, nlwExtra
);
218 mfbTileAreaPPW (pDraw
, nbox
, pbox
, alu
, ptile
)
226 DrawablePtr
/*pDraw*/,
230 PixmapPtr
/*ptile*/);
233 f
= mfbTileAreaPPWCopy
;
235 f
= mfbTileAreaPPWGeneral
;
236 (*f
) (pDraw
, nbox
, pbox
, alu
, ptile
);