2
* $XFree86: xc/programs/Xserver/fb/fbsolid.c,v 1.8 2001/10/28 03:33:08 tsi Exp $
4
* Copyright � 1998 Keith Packard
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
10
* documentation, and that the name of Keith Packard not be used in
11
* advertising or publicity pertaining to distribution of the software without
12
* specific, written prior permission. Keith Packard makes no
13
* representations about the suitability of this software for any purpose. It
14
* is provided "as is" without express or implied warranty.
16
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
* PERFORMANCE OF THIS SOFTWARE.
25
#define FbSelectPart(xor,o,t) xor
41
FbBits startmask, endmask;
43
int startbyte, endbyte;
46
if (bpp == 24 && (!FbCheck24Pix(and) || !FbCheck24Pix(xor)))
48
fbSolid24 (dst, dstStride, dstX, width, height, and, xor);
53
dst += dstX >> FB_SHIFT;
55
FbMaskBitsBytes(dstX, width, and == 0, startmask, startbyte,
56
nmiddle, endmask, endbyte);
64
FbDoLeftMaskByteRRop(dst,startbyte,startmask,and,xor);
74
*dst = FbDoRRop (*dst, and, xor);
78
FbDoRightMaskByteRRop(dst,endbyte,endmask,and,xor);
85
fbSolid24 (FbBits *dst,
95
FbBits startmask, endmask;
96
FbBits xor0 = 0, xor1 = 0, xor2 = 0;
97
FbBits and0 = 0, and1 = 0, and2 = 0;
98
FbBits xorS = 0, andS = 0, xorE = 0, andE = 0;
102
dst += dstX >> FB_SHIFT;
105
* Rotate pixel values this far across the word to align on
106
* screen pixel boundaries
108
rot = FbFirst24Rot (dstX);
109
FbMaskBits (dstX, width, startmask, nmiddle, endmask);
112
dstStride -= nmiddle;
115
* Precompute rotated versions of the rasterop values
118
xor = FbRot24(xor,rotS);
119
and = FbRot24(and,rotS);
124
xor = FbNext24Pix(xor);
125
and = FbNext24Pix(and);
132
xor1 = FbNext24Pix(xor0);
133
and1 = FbNext24Pix(and0);
134
xor2 = FbNext24Pix(xor1);
135
and2 = FbNext24Pix(and1);
140
switch (nmiddle % 3) {
160
*dst = FbDoMaskRRop(*dst, andS, xorS, startmask);
187
*dst = FbDoRRop (*dst, and0, xor0);
189
*dst = FbDoRRop (*dst, and1, xor1);
191
*dst = FbDoRRop (*dst, and2, xor2);
197
*dst = FbDoRRop (*dst, and0, xor0);
202
*dst = FbDoRRop (*dst, and1, xor1);
208
*dst = FbDoMaskRRop (*dst, andE, xorE, endmask);