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
27
#ifdef HAVE_DIX_CONFIG_H
28
#include <dix-config.h>
45
FbBits startmask, endmask;
47
int startbyte, endbyte;
50
if (bpp == 24 && (!FbCheck24Pix(and) || !FbCheck24Pix(xor)))
52
fbSolid24 (dst, dstStride, dstX, width, height, and, xor);
56
dst += dstX >> FB_SHIFT;
58
FbMaskBitsBytes(dstX, width, and == 0, startmask, startbyte,
59
nmiddle, endmask, endbyte);
67
FbDoLeftMaskByteRRop(dst,startbyte,startmask,and,xor);
77
*dst = FbDoRRop (*dst, and, xor);
81
FbDoRightMaskByteRRop(dst,endbyte,endmask,and,xor);
88
fbSolid24 (FbBits *dst,
98
FbBits startmask, endmask;
99
FbBits xor0 = 0, xor1 = 0, xor2 = 0;
100
FbBits and0 = 0, and1 = 0, and2 = 0;
101
FbBits xorS = 0, andS = 0, xorE = 0, andE = 0;
105
dst += dstX >> FB_SHIFT;
108
* Rotate pixel values this far across the word to align on
109
* screen pixel boundaries
111
rot = FbFirst24Rot (dstX);
112
FbMaskBits (dstX, width, startmask, nmiddle, endmask);
115
dstStride -= nmiddle;
118
* Precompute rotated versions of the rasterop values
121
xor = FbRot24(xor,rotS);
122
and = FbRot24(and,rotS);
127
xor = FbNext24Pix(xor);
128
and = FbNext24Pix(and);
135
xor1 = FbNext24Pix(xor0);
136
and1 = FbNext24Pix(and0);
137
xor2 = FbNext24Pix(xor1);
138
and2 = FbNext24Pix(and1);
143
switch (nmiddle % 3) {
163
*dst = FbDoMaskRRop(*dst, andS, xorS, startmask);
190
*dst = FbDoRRop (*dst, and0, xor0);
192
*dst = FbDoRRop (*dst, and1, xor1);
194
*dst = FbDoRRop (*dst, and2, xor2);
200
*dst = FbDoRRop (*dst, and0, xor0);
205
*dst = FbDoRRop (*dst, and1, xor1);
211
*dst = FbDoMaskRRop (*dst, andE, xorE, endmask);