4 * Defines which are only useful to 8 bit color frame buffers
6 * That doesn't seem to be true any more. Some of the macros in here
7 * are used for depths other than 8. Perhaps the file should be
13 Copyright 1989, 1998 The Open Group
15 Permission to use, copy, modify, distribute, and sell this software and its
16 documentation for any purpose is hereby granted without fee, provided that
17 the above copyright notice appear in all copies and that both that
18 copyright notice and this permission notice appear in supporting
21 The above copyright notice and this permission notice shall be included in
22 all copies or substantial portions of the Software.
24 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
28 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 Except as contained in this notice, the name of The Open Group shall not be
32 used in advertising or otherwise to promote the sale, use or other dealings
33 in this Software without prior written authorization from The Open Group.
37 #ifdef HAVE_DIX_CONFIG_H
38 #include <dix-config.h>
43 #if (BITMAP_BIT_ORDER == MSBFirst)
44 #define GetBitGroup(x) (((PixelGroup) (x)) >> (PGSZ - PGSZB))
45 #define NextBitGroup(x) ((x) <<= PGSZB)
46 #define NextSomeBits(x,n) ((x) <<= (n))
48 #define GetBitGroup(x) ((x) & PGSZBMSK)
49 #define NextBitGroup(x) ((x) >>= PGSZB)
50 #define NextSomeBits(x,n) ((x) >>= (n))
53 #define RotBitsLeft(x,k) ((x) = BitLeft (x,k) | \
54 BitRight (x, PGSZ-(k)))
56 #if defined(__GNUC__) && defined(mc68020)
58 #define RotBitsLeft(x,k) asm("rol%.l %2,%0" \
65 #define GetPixelGroup(x) (cfb8StippleXor[GetBitGroup(x)])
66 #define RRopPixels(dst,x) (DoRRop(dst,cfb8StippleAnd[x], cfb8StippleXor[x]))
67 #define RRopPixelGroup(dst,x) (RRopPixels(dst,GetBitGroup(x)))
68 #define MaskRRopPixels(dst,x,mask) (DoMaskRRop(dst,cfb8StippleAnd[x], cfb8StippleXor[x], mask))
70 #define NUM_MASKS (1<<PPW) /* XXX goes in cfbmskbits.h? */
71 extern int cfb8StippleMode
, cfb8StippleAlu
;
72 extern PixelGroup cfb8StippleFg
, cfb8StippleBg
, cfb8StipplePm
;
73 extern PixelGroup cfb8StippleMasks
[NUM_MASKS
];
74 extern PixelGroup cfb8StippleAnd
[NUM_MASKS
], cfb8StippleXor
[NUM_MASKS
];
75 extern int cfb8StippleRRop
;
77 #define cfb8PixelMasks cfb8StippleMasks
78 #define cfb8Pixels cfb8StippleXor
80 #define cfb8CheckPixels(fg, bg) \
81 (FillOpaqueStippled == cfb8StippleMode && \
82 GXcopy == cfb8StippleAlu && \
83 ((fg) & PMSK) == cfb8StippleFg && \
84 ((bg) & PMSK) == cfb8StippleBg && \
85 PMSK == cfb8StipplePm)
87 #define cfb8CheckOpaqueStipple(alu,fg,bg,pm) \
88 ((FillOpaqueStippled == cfb8StippleMode && \
89 (alu) == cfb8StippleAlu && \
90 ((fg) & PMSK) == cfb8StippleFg && \
91 ((bg) & PMSK) == cfb8StippleBg && \
92 ((pm) & PMSK) == cfb8StipplePm) ? 0 : cfb8SetOpaqueStipple(alu,fg,bg,pm))
94 #define cfb8CheckStipple(alu,fg,pm) \
95 ((FillStippled == cfb8StippleMode && \
96 (alu) == cfb8StippleAlu && \
97 ((fg) & PMSK) == cfb8StippleFg && \
98 ((pm) & PMSK) == cfb8StipplePm) ? 0 : cfb8SetStipple(alu,fg,pm))
100 #define cfb8SetPixels(fg,bg) cfb8SetOpaqueStipple(GXcopy,fg,bg,PMSK)
103 * These macros are shared between the unnatural spans code
104 * and the unnatural rectangle code. No reasonable person
105 * would attempt to use them anyplace else.
108 #define NextUnnaturalStippleWord \
109 if (bitsLeft >= MFB_PPW) \
111 inputBits = *srcTemp++; \
112 bitsLeft -= MFB_PPW; \
113 partBitsLeft = MFB_PPW; \
119 inputBits = *srcTemp & ~cfb8BitLenMasks[bitsLeft]; \
120 srcTemp = srcStart; \
121 partBitsLeft = bitsLeft; \
122 bitsLeft = bitsWhole; \
125 #define NextUnnaturalStippleBits \
126 if (partBitsLeft >= PPW) { \
127 bits = GetBitGroup (inputBits); \
128 NextBitGroup (inputBits); \
129 partBitsLeft -= PPW; \
131 bits = GetBitGroup (inputBits); \
132 nextPartBits = PPW - partBitsLeft; \
133 NextUnnaturalStippleWord \
134 if (partBitsLeft < nextPartBits) { \
136 bits |= BitRight (GetBitGroup (inputBits), \
137 PPW - nextPartBits) & PPWMSK;\
138 nextPartBits -= partBitsLeft; \
140 NextUnnaturalStippleWord \
142 bits |= BitRight (GetBitGroup (inputBits), \
143 PPW - nextPartBits) & PPWMSK; \
144 NextSomeBits (inputBits, nextPartBits); \
145 partBitsLeft -= nextPartBits; \
148 #define NextUnnaturalStippleBitsFast \
149 if (partBitsLeft >= PPW) { \
150 bits = GetBitGroup(inputBits); \
151 NextBitGroup(inputBits); \
152 partBitsLeft -= PPW; \
154 bits = GetBitGroup (inputBits); \
155 nextPartBits = PPW - partBitsLeft; \
156 inputBits = *srcTemp++; \
157 bits |= BitRight (GetBitGroup (inputBits), \
158 partBitsLeft) & PPWMSK; \
159 NextSomeBits (inputBits, nextPartBits); \
160 partBitsLeft = MFB_PPW - nextPartBits; \
164 * WriteBitGroup takes the destination address, a pixel
165 * value (which must be 8 bits duplicated 4 time with PFILL)
166 * and the PPW bits to write, which must be in the low order
167 * bits of the register (probably from GetBitGroup) and writes
168 * the appropriate locations in memory with the pixel value. This
169 * is a copy-mode only operation.
172 #define RRopBitGroup(dst,bits) \
174 *(dst) = RRopPixels(*(dst),bits); \
177 #define MaskRRopBitGroup(dst,bits,mask) \
179 *(dst) = MaskRRopPixels(*(dst),bits,mask); \
181 #endif /* PSZ == 8 */
183 #if !defined(AVOID_MEMORY_READ) && PSZ == 8
185 #define WriteBitGroup(dst,pixel,bits) \
187 register PixelGroup _maskTmp = cfb8PixelMasks[(bits)]; \
188 *(dst) = (*(dst) & ~_maskTmp) | ((pixel) & _maskTmp); \
191 #define SwitchBitGroup(dst,pixel,bits) \
193 register PixelGroup _maskTmp = cfb8PixelMasks[(bits)]; \
194 register PixelGroup _pixTmp = ((pixel) & _maskTmp); \
195 _maskTmp = ~_maskTmp; \
196 SwitchBitsLoop (*(dst) = (*(dst) & _maskTmp) | _pixTmp;) \
199 #else /* AVOID_MEMORY_READ */
202 #if (BITMAP_BIT_ORDER == MSBFirst)
203 #define SinglePixel0 3
204 #define SinglePixel1 2
205 #define SinglePixel2 1
206 #define SinglePixel3 0
207 #define SinglePixel4 7
208 #define SinglePixel5 6
209 #define SinglePixel6 5
210 #define SinglePixel7 4
211 #define SinglePixel8 0xB
212 #define SinglePixel9 0xA
213 #define DoublePixel0 1
214 #define DoublePixel1 0
215 #define DoublePixel2 3
216 #define DoublePixel3 2
217 #define DoublePixel4 5
218 #define DoublePixel5 4
220 #define SinglePixel0 0
221 #define SinglePixel1 1
222 #define SinglePixel2 2
223 #define SinglePixel3 3
224 #define SinglePixel4 4
225 #define SinglePixel5 5
226 #define SinglePixel6 6
227 #define SinglePixel7 7
228 #define SinglePixel8 8
229 #define SinglePixel9 9
230 #define DoublePixel0 0
231 #define DoublePixel1 1
232 #define DoublePixel2 2
233 #define DoublePixel3 3
234 #define DoublePixel4 4
235 #define DoublePixel5 5
240 #else /* PGSZ == 64 */
241 #if (BITMAP_BIT_ORDER == MSBFirst)
242 #define SinglePixel0 7
243 #define SinglePixel1 6
244 #define SinglePixel2 5
245 #define SinglePixel3 4
246 #define SinglePixel4 3
247 #define SinglePixel5 2
248 #define SinglePixel6 1
249 #define SinglePixel7 0
250 #define DoublePixel0 3
251 #define DoublePixel1 2
252 #define DoublePixel2 1
253 #define DoublePixel3 0
257 #define SinglePixel0 0
258 #define SinglePixel1 1
259 #define SinglePixel2 2
260 #define SinglePixel3 3
261 #define SinglePixel4 4
262 #define SinglePixel5 5
263 #define SinglePixel6 6
264 #define SinglePixel7 7
265 #define DoublePixel0 0
266 #define DoublePixel1 1
267 #define DoublePixel2 2
268 #define DoublePixel3 3
273 #endif /* PGSZ == 64 */
278 #define WriteBitGroup(dst,pixel,bits) \
283 ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
286 ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
289 ((CARD16 *) (dst))[DoublePixel0] = (pixel); \
292 ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
295 ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
296 ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
299 ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
300 ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
303 ((CARD16 *) (dst))[DoublePixel0] = (pixel); \
304 ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
307 ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
310 ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
311 ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
314 ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
315 ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
318 ((CARD16 *) (dst))[DoublePixel0] = (pixel); \
319 ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
322 ((CARD16 *) (dst))[DoublePixel1] = (pixel); \
325 ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
326 ((CARD16 *) (dst))[DoublePixel1] = (pixel); \
329 ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
330 ((CARD16 *) (dst))[DoublePixel1] = (pixel); \
333 ((CARD32 *) (dst))[0] = (pixel); \
336 #else /* PGSZ == 64 */
337 #define WriteBitGroup(dst,pixel,bits) \
338 if ( bits == 0xff ) \
339 ((PixelGroup *) (dst))[OctaPixel0] = (pixel); \
341 switch (bits & 0x0f) { \
345 ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
348 ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
351 ((CARD16 *) (dst))[DoublePixel0] = (pixel); \
354 ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
357 ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
358 ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
361 ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
362 ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
365 ((CARD16 *) (dst))[DoublePixel0] = (pixel); \
366 ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
369 ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
372 ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
373 ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
376 ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
377 ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
380 ((CARD16 *) (dst))[DoublePixel0] = (pixel); \
381 ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
384 ((CARD16 *) (dst))[DoublePixel1] = (pixel); \
387 ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
388 ((CARD16 *) (dst))[DoublePixel1] = (pixel); \
391 ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
392 ((CARD16 *) (dst))[DoublePixel1] = (pixel); \
395 ((CARD32 *) (dst))[QuadPixel0] = (pixel); \
398 switch ((bits & 0xf0) >> 4) { \
402 ((CARD8 *) (dst))[SinglePixel4] = (pixel); \
405 ((CARD8 *) (dst))[SinglePixel5] = (pixel); \
408 ((CARD16 *) (dst))[DoublePixel2] = (pixel); \
411 ((CARD8 *) (dst))[SinglePixel6] = (pixel); \
414 ((CARD8 *) (dst))[SinglePixel4] = (pixel); \
415 ((CARD8 *) (dst))[SinglePixel6] = (pixel); \
418 ((CARD8 *) (dst))[SinglePixel5] = (pixel); \
419 ((CARD8 *) (dst))[SinglePixel6] = (pixel); \
422 ((CARD16 *) (dst))[DoublePixel2] = (pixel); \
423 ((CARD8 *) (dst))[SinglePixel6] = (pixel); \
426 ((CARD8 *) (dst))[SinglePixel7] = (pixel); \
429 ((CARD8 *) (dst))[SinglePixel4] = (pixel); \
430 ((CARD8 *) (dst))[SinglePixel7] = (pixel); \
433 ((CARD8 *) (dst))[SinglePixel5] = (pixel); \
434 ((CARD8 *) (dst))[SinglePixel7] = (pixel); \
437 ((CARD16 *) (dst))[DoublePixel2] = (pixel); \
438 ((CARD8 *) (dst))[SinglePixel7] = (pixel); \
441 ((CARD16 *) (dst))[DoublePixel3] = (pixel); \
444 ((CARD8 *) (dst))[SinglePixel4] = (pixel); \
445 ((CARD16 *) (dst))[DoublePixel3] = (pixel); \
448 ((CARD8 *) (dst))[SinglePixel5] = (pixel); \
449 ((CARD16 *) (dst))[DoublePixel3] = (pixel); \
452 ((CARD32 *) (dst))[QuadPixel1] = (pixel); \
456 #endif /* PGSZ == 64 */
459 #define SwitchBitGroup(dst,pixel,bits) { \
464 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel);) \
467 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel);) \
470 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel);) \
473 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
476 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \
477 ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
480 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \
481 ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
484 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
485 ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
488 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
491 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \
492 ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
495 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \
496 ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
499 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
500 ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
503 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel1] = (pixel);) \
506 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \
507 ((CARD16 *) (dst))[DoublePixel1] = (pixel);) \
510 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \
511 ((CARD16 *) (dst))[DoublePixel1] = (pixel);) \
514 SwitchBitsLoop (((CARD32 *) (dst))[0] = (pixel);) \
518 #else /* PGSZ == 64 */
519 #define SwitchBitGroup(dst,pixel,bits) { \
520 if ( bits == 0xff ) \
521 SwitchBitsLoop (((PixelGroup *) (dst))[OctaPixel0] = (pixel);) \
523 switch (bits & 0x0f) { \
527 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel);) \
530 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel);) \
533 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel);)\
536 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
539 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \
540 ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
543 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \
544 ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
547 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
548 ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
551 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
554 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \
555 ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
558 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \
559 ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
562 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
563 ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
566 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel1] = (pixel);)\
569 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \
570 ((CARD16 *) (dst))[DoublePixel1] = (pixel);)\
573 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \
574 ((CARD16 *) (dst))[DoublePixel1] = (pixel);)\
577 SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel);) \
580 switch ((bits & 0xf0) >> 4) { \
584 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel4] = (pixel);) \
587 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel5] = (pixel);) \
590 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel2] = (pixel);)\
593 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel6] = (pixel);) \
596 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel4] = (pixel); \
597 ((CARD8 *) (dst))[SinglePixel6] = (pixel);) \
600 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel5] = (pixel); \
601 ((CARD8 *) (dst))[SinglePixel6] = (pixel);) \
604 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel2] = (pixel); \
605 ((CARD8 *) (dst))[SinglePixel6] = (pixel);) \
608 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel7] = (pixel);) \
611 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel4] = (pixel); \
612 ((CARD8 *) (dst))[SinglePixel7] = (pixel);) \
615 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel5] = (pixel); \
616 ((CARD8 *) (dst))[SinglePixel7] = (pixel);) \
619 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel2] = (pixel); \
620 ((CARD8 *) (dst))[SinglePixel7] = (pixel);) \
623 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel3] = (pixel);)\
626 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel4] = (pixel); \
627 ((CARD16 *) (dst))[DoublePixel3] = (pixel);)\
630 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel5] = (pixel); \
631 ((CARD16 *) (dst))[DoublePixel3] = (pixel);)\
634 SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel1] = (pixel);) \
639 #endif /* PGSZ == 64 */
640 #endif /* PSZ == 8 */
645 #define WriteBitGroup(dst,pixel,bits) \
650 ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
653 ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
656 ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
659 ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
662 ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
663 ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
666 ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
667 ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
670 ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
671 ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
674 ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
677 ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
678 ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
681 ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
682 ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
685 ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
686 ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
689 ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
692 ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
693 ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
696 ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
697 ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
700 ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
701 ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
704 #else /* PGSZ == 64 */
705 #define WriteBitGroup(dst,pixel,bits) \
706 if ( bits == 0xff ) { \
707 ((PixelGroup *) (dst))[QuadPixel0] = (pixel); \
708 ((PixelGroup *) (dst))[QuadPixel1] = (pixel); \
711 switch (bits & 0x0f) { \
715 ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
718 ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
721 ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
724 ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
727 ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
728 ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
731 ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
732 ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
735 ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
736 ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
739 ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
742 ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
743 ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
746 ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
747 ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
750 ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
751 ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
754 ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
757 ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
758 ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
761 ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
762 ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
765 ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
766 ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
769 switch ((bits & 0xf0) >> 4) { \
773 ((CARD16 *) (dst))[SinglePixel4] = (pixel); \
776 ((CARD16 *) (dst))[SinglePixel5] = (pixel); \
779 ((CARD32 *) (dst))[DoublePixel2] = (pixel); \
782 ((CARD16 *) (dst))[SinglePixel6] = (pixel); \
785 ((CARD16 *) (dst))[SinglePixel4] = (pixel); \
786 ((CARD16 *) (dst))[SinglePixel6] = (pixel); \
789 ((CARD16 *) (dst))[SinglePixel5] = (pixel); \
790 ((CARD16 *) (dst))[SinglePixel6] = (pixel); \
793 ((CARD32 *) (dst))[DoublePixel2] = (pixel); \
794 ((CARD16 *) (dst))[SinglePixel6] = (pixel); \
797 ((CARD16 *) (dst))[SinglePixel7] = (pixel); \
800 ((CARD16 *) (dst))[SinglePixel4] = (pixel); \
801 ((CARD16 *) (dst))[SinglePixel7] = (pixel); \
804 ((CARD16 *) (dst))[SinglePixel5] = (pixel); \
805 ((CARD16 *) (dst))[SinglePixel7] = (pixel); \
808 ((CARD32 *) (dst))[DoublePixel2] = (pixel); \
809 ((CARD16 *) (dst))[SinglePixel7] = (pixel); \
812 ((CARD32 *) (dst))[DoublePixel3] = (pixel); \
815 ((CARD16 *) (dst))[SinglePixel4] = (pixel); \
816 ((CARD32 *) (dst))[DoublePixel3] = (pixel); \
819 ((CARD16 *) (dst))[SinglePixel5] = (pixel); \
820 ((CARD32 *) (dst))[DoublePixel3] = (pixel); \
823 ((CARD32 *) (dst))[DoublePixel2] = (pixel); \
824 ((CARD32 *) (dst))[DoublePixel3] = (pixel); \
831 #define SwitchBitGroup(dst,pixel,bits) { \
836 SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel);) \
839 SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel1] = (pixel);) \
842 SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel0] = (pixel);) \
845 SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel2] = (pixel);) \
848 SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel); \
849 ((CARD16 *) (dst))[SinglePixel2] = (pixel);) \
852 SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel1] = (pixel); \
853 ((CARD16 *) (dst))[SinglePixel2] = (pixel);) \
856 SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel0] = (pixel); \
857 ((CARD16 *) (dst))[SinglePixel2] = (pixel);) \
860 SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel3] = (pixel);) \
863 SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel); \
864 ((CARD16 *) (dst))[SinglePixel3] = (pixel);) \
867 SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel1] = (pixel); \
868 ((CARD16 *) (dst))[SinglePixel3] = (pixel);) \
871 SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel0] = (pixel); \
872 ((CARD16 *) (dst))[SinglePixel3] = (pixel);) \
875 SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel1] = (pixel);) \
878 SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel); \
879 ((CARD32 *) (dst))[DoublePixel1] = (pixel);) \
882 SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel1] = (pixel); \
883 ((CARD32 *) (dst))[DoublePixel1] = (pixel);) \
886 SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel0] = (pixel); \
887 ((CARD32 *) (dst))[DoublePixel1] = (pixel);) \
891 #else /* PGSZ == 64 */
892 #define SwitchBitGroup(dst,pixel,bits) { \
893 cfb cannot hack 64-bit SwitchBitGroup psz=PSZ
896 #endif /* PSZ == 16 */
904 #define WriteBitGroup(dst,pixel,bits) \
906 register CARD32 reg_pixel = (pixel); \
911 ((CARD16 *) (dst))[DoublePixel0] = reg_pixel; \
912 ((CARD8 *) (dst))[SinglePixel2] = ((reg_pixel>>16)&0xFF); \
915 ((CARD8 *) (dst))[SinglePixel3] = reg_pixel&0xFF; \
916 ((CARD16 *) (dst))[DoublePixel2] = (reg_pixel>>8)&0xFFFF; \
919 ((CARD8 *) (dst))[SinglePixel3] = reg_pixel & 0xFF; \
920 ((CARD16 *) (dst))[DoublePixel0] = reg_pixel; \
921 ((CARD16 *) (dst))[DoublePixel2] = (reg_pixel>>8)&0xFFFF; \
922 ((CARD8 *) (dst))[SinglePixel2] = (reg_pixel>>16&0xFF); \
925 ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
926 ((CARD8 *) (dst))[SinglePixel8] = (reg_pixel>>16)&0xFF; \
929 ((CARD16 *) (dst))[DoublePixel0] = \
930 ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
932 ((CARD8 *) (dst))[SinglePixel2] = \
933 ((CARD8 *) (dst))[SinglePixel8] = reg_pixel&0xFF; \
936 ((CARD8 *) (dst))[SinglePixel3] = reg_pixel; \
937 ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
939 ((CARD16 *) (dst))[DoublePixel2] = reg_pixel; \
941 ((CARD8 *) (dst))[SinglePixel8] = reg_pixel&0xFF; \
944 ((CARD16 *) (dst))[DoublePixel0] = \
945 ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
946 ((CARD8 *) (dst))[SinglePixel3] = reg_pixel&0xFF; \
948 ((CARD16 *) (dst))[DoublePixel2] = reg_pixel; \
950 ((CARD8 *) (dst))[SinglePixel2] = \
951 ((CARD8 *) (dst))[SinglePixel8] = reg_pixel&0xFF; \
954 ((CARD8 *) (dst))[SinglePixel9] = reg_pixel&0xFF; \
955 ((CARD16 *) (dst))[DoublePixel5] = (reg_pixel>>8); \
958 ((CARD16 *) (dst))[DoublePixel0] = reg_pixel; \
959 ((CARD8 *) (dst))[SinglePixel9] = reg_pixel&0xFF; \
961 ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
963 ((CARD8 *) (dst))[SinglePixel2] = reg_pixel&0xFF; \
966 ((CARD8 *) (dst))[SinglePixel3] = \
967 ((CARD8 *) (dst))[SinglePixel9] = reg_pixel&0xFF; \
969 ((CARD16 *) (dst))[DoublePixel2] = \
970 ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
973 ((CARD8 *) (dst))[SinglePixel3] = \
974 ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \
975 ((CARD16 *) (dst))[DoublePixel0] = reg_pixel; \
977 ((CARD16 *) (dst))[DoublePixel2] = \
978 ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
980 ((CARD8 *) (dst))[SinglePixel2] = reg_pixel; \
983 ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
984 ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \
986 ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
988 ((CARD8 *) (dst))[SinglePixel8] = reg_pixel; \
991 ((CARD16 *) (dst))[DoublePixel0] = \
992 ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
993 ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \
995 ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
997 ((CARD8 *) (dst))[SinglePixel2] = \
998 ((CARD8 *) (dst))[SinglePixel8] = reg_pixel; \
1001 ((CARD8 *) (dst))[SinglePixel3] = \
1002 ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \
1003 ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
1005 ((CARD16 *) (dst))[DoublePixel2] = \
1006 ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
1008 ((CARD8 *) (dst))[SinglePixel8] = reg_pixel; \
1011 ((CARD16 *) (dst))[DoublePixel0] = \
1012 ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
1013 ((CARD8 *) (dst))[SinglePixel3] = \
1014 ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \
1016 ((CARD16 *) (dst))[DoublePixel2] = \
1017 ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
1019 ((CARD8 *) (dst))[SinglePixel8] = \
1020 ((CARD8 *) (dst))[SinglePixel2] = reg_pixel; \
1024 #else /* PGSZ == 64 */
1025 #define WriteBitGroup(dst,pixel,bits) \
1026 if ( bits == 0xff ) { \
1027 ((PixelGroup *) (dst))[DoublePixel0] = (pixel); \
1028 ((PixelGroup *) (dst))[DoublePixel1] = (pixel); \
1029 ((PixelGroup *) (dst))[DoublePixel2] = (pixel); \
1030 ((PixelGroup *) (dst))[DoublePixel3] = (pixel); \
1033 switch (bits & 0x0f) { \
1037 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1040 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1043 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1044 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1047 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1050 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1051 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1054 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1055 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1058 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1059 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1060 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1063 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1066 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1067 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1070 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1071 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1074 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1075 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1076 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1079 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1080 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1083 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1084 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1085 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1088 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1089 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1090 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1093 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1094 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1095 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1096 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1099 switch ((bits & 0xf0) >> 4) { \
1103 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1106 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1109 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1110 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1113 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1116 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1117 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1120 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1121 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1124 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1125 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1126 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1129 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1132 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1133 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1136 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1137 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1140 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1141 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1142 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1145 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1146 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1149 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1150 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1151 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1154 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1155 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1156 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1159 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1160 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1161 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1162 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1169 #define SwitchBitGroup(dst,pixel,bits) { \
1174 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
1175 ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
1178 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel); \
1179 ((CARD16 *) (dst))[DoublePixel2] = (pixel);) \
1182 SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel); \
1183 ((CARD16 *) (dst))[DoublePixel2] = (pixel);) \
1186 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel3] = (pixel); \
1187 ((CARD8 *) (dst))[SinglePixel8] = (pixel);) \
1190 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
1191 ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
1192 ((CARD16 *) (dst))[DoublePixel3] = (pixel); \
1193 ((CARD8 *) (dst))[SinglePixel8] = (pixel);) \
1196 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel); \
1197 ((CARD32 *) (dst))[QuadPixel2] = (pixel); \
1198 ((CARD8 *) (dst))[SinglePixel8] = (pixel);) \
1201 SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel); \
1202 ((CARD32 *) (dst))[QuadPixel1] = (pixel); \
1203 ((CARD8 *) (dst))[SinglePixel8] = (pixel);) \
1206 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel9] = (pixel); \
1207 ((CARD16 *) (dst))[DoublePixel5] = (pixel);) \
1210 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
1211 ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
1212 ((CARD8 *) (dst))[SinglePixel9] = (pixel); \
1213 ((CARD16 *) (dst))[DoublePixel5] = (pixel);) \
1216 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel); \
1217 ((CARD16 *) (dst))[DoublePixel2] = (pixel); \
1218 ((CARD8 *) (dst))[SinglePixel9] = (pixel); \
1219 ((CARD16 *) (dst))[DoublePixel5] = (pixel);) \
1222 SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel); \
1223 ((CARD16 *) (dst))[DoublePixel3] = (pixel);) \
1224 ((CARD8 *) (dst))[SinglePixel9] = (pixel); \
1225 ((CARD16 *) (dst))[DoublePixel5] = (pixel);) \
1228 SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel3] = (pixel); \
1229 ((CARD32 *) (dst))[QuadPixel2] = (pixel);) \
1232 SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel); \
1233 ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
1234 ((CARD16 *) (dst))[DoublePixel3] = (pixel); \
1235 ((CARD32 *) (dst))[QuadPixel2] = (pixel);) \
1238 SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel); \
1239 ((CARD32 *) (dst))[QuadPixel1] = (pixel); \
1240 ((CARD32 *) (dst))[QuadPixel2] = (pixel);) \
1243 SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel); \
1244 ((CARD32 *) (dst))[QuadPixel1] = (pixel); \
1245 ((CARD32 *) (dst))[QuadPixel2] = (pixel);) \
1249 #else /* PGSZ == 64 */
1250 #define SwitchBitGroup(dst,pixel,bits) { \
1251 cfb cannot hack 64-bit SwitchBitGroup psz=PSZ
1254 #endif /* PSZ == 24 */
1259 #define WriteBitGroup(dst,pixel,bits) \
1264 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1267 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1270 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1271 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1274 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1277 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1278 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1281 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1282 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1285 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1286 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1287 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1290 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1293 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1294 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1297 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1298 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1301 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1302 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1303 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1306 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1307 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1310 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1311 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1312 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1315 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1316 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1317 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1320 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1321 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1322 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1323 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1326 #else /* PGSZ == 64 */
1327 #define WriteBitGroup(dst,pixel,bits) \
1328 if ( bits == 0xff ) { \
1329 ((PixelGroup *) (dst))[DoublePixel0] = (pixel); \
1330 ((PixelGroup *) (dst))[DoublePixel1] = (pixel); \
1331 ((PixelGroup *) (dst))[DoublePixel2] = (pixel); \
1332 ((PixelGroup *) (dst))[DoublePixel3] = (pixel); \
1335 switch (bits & 0x0f) { \
1339 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1342 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1345 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1346 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1349 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1352 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1353 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1356 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1357 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1360 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1361 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1362 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1365 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1368 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1369 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1372 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1373 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1376 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1377 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1378 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1381 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1382 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1385 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1386 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1387 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1390 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1391 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1392 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1395 ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1396 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1397 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1398 ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
1401 switch ((bits & 0xf0) >> 4) { \
1405 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1408 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1411 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1412 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1415 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1418 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1419 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1422 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1423 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1426 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1427 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1428 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1431 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1434 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1435 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1438 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1439 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1442 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1443 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1444 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1447 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1448 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1451 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1452 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1453 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1456 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1457 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1458 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1461 ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
1462 ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
1463 ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
1464 ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
1471 #define SwitchBitGroup(dst,pixel,bits) { \
1476 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel);) \
1479 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel1] = (pixel);) \
1482 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1483 ((CARD32 *) (dst))[SinglePixel1] = (pixel);) \
1486 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel2] = (pixel);) \
1489 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1490 ((CARD32 *) (dst))[SinglePixel2] = (pixel);) \
1493 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1494 ((CARD32 *) (dst))[SinglePixel2] = (pixel);) \
1497 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1498 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1499 ((CARD32 *) (dst))[SinglePixel2] = (pixel);) \
1502 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
1505 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1506 ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
1509 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1510 ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
1513 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1514 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1515 ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
1518 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1519 ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
1522 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1523 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1524 ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
1527 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1528 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1529 ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
1532 SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
1533 ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
1534 ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
1535 ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
1539 #else /* PGSZ == 64 */
1540 #define SwitchBitGroup(dst,pixel,bits) { \
1541 cfb cannot hack 64-bit SwitchBitGroup psz=PSZ
1544 #endif /* PSZ == 32 */
1545 #endif /* AVOID_MEMORY_READ */
1547 extern PixelGroup cfb8BitLenMasks
[PGSZ
];
1549 extern int cfb8SetStipple (
1552 CfbBits
/*planemask*/
1555 extern int cfb8SetOpaqueStipple (
1559 CfbBits
/*planemask*/
1562 extern int cfb8ComputeClipMasks32 (