1
2#ifndef _XAALOCAL_H
3#define _XAALOCAL_H
4
5/* This file is very unorganized ! */
6
7
8#include "gcstruct.h"
9#include "regionstr.h"
10#include "xf86fbman.h"
11#include "xaa.h"
12#include "mi.h"
13#include "picturestr.h"
14
15#define GCWhenForced		(GCArcMode << 1)
16
17#define DO_COLOR_8x8		0x00000001
18#define DO_MONO_8x8		0x00000002
19#define DO_CACHE_BLT		0x00000003
20#define DO_COLOR_EXPAND		0x00000004
21#define DO_CACHE_EXPAND		0x00000005
22#define DO_IMAGE_WRITE		0x00000006
23#define DO_PIXMAP_COPY		0x00000007
24#define DO_SOLID		0x00000008
25
26
27typedef CARD32 * (*GlyphScanlineFuncPtr)(
28    CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
29);
30
31typedef CARD32 *(*StippleScanlineProcPtr)(CARD32*, CARD32*, int, int, int);
32
33typedef void (*RectFuncPtr) (ScrnInfoPtr, int, int, int, int, int, int,
34					  XAACacheInfoPtr);
35typedef void (*TrapFuncPtr) (ScrnInfoPtr, int, int, int, int, int, int,
36					  int, int, int, int, int, int,
37					  XAACacheInfoPtr);
38
39
40
41typedef struct _XAAScreen {
42   CreateGCProcPtr 		CreateGC;
43   CloseScreenProcPtr 		CloseScreen;
44   GetImageProcPtr 		GetImage;
45   GetSpansProcPtr 		GetSpans;
46   CopyWindowProcPtr 		CopyWindow;
47   WindowExposuresProcPtr	WindowExposures;
48   CreatePixmapProcPtr 		CreatePixmap;
49   DestroyPixmapProcPtr 	DestroyPixmap;
50   ChangeWindowAttributesProcPtr ChangeWindowAttributes;
51   XAAInfoRecPtr 		AccelInfoRec;
52   Bool                		(*EnterVT)(int, int);
53   void                		(*LeaveVT)(int, int);
54   int				(*SetDGAMode)(int, int, DGADevicePtr);
55   void				(*EnableDisableFBAccess)(int, Bool);
56    CompositeProcPtr            Composite;
57    GlyphsProcPtr               Glyphs;
58} XAAScreenRec, *XAAScreenPtr;
59
60#define	OPS_ARE_PIXMAP		0x00000001
61#define OPS_ARE_ACCEL		0x00000002
62
63typedef struct _XAAGC {
64    GCOps 	*wrapOps;
65    GCFuncs 	*wrapFuncs;
66    GCOps 	*XAAOps;
67    int		DashLength;
68    unsigned char* DashPattern;
69    unsigned long changes;
70    unsigned long flags;
71} XAAGCRec, *XAAGCPtr;
72
73#define REDUCIBILITY_CHECKED	0x00000001
74#define REDUCIBLE_TO_8x8	0x00000002
75#define REDUCIBLE_TO_2_COLOR	0x00000004
76#define DIRTY			0x00010000
77#define OFFSCREEN		0x00020000
78#define DGA_PIXMAP		0x00040000
79#define SHARED_PIXMAP		0x00080000
80#define LOCKED_PIXMAP		0x00100000
81
82#define REDUCIBILITY_MASK \
83 (REDUCIBILITY_CHECKED | REDUCIBLE_TO_8x8 | REDUCIBLE_TO_2_COLOR)
84
85typedef struct _XAAPixmap {
86    unsigned long flags;
87    CARD32 pattern0;
88    CARD32 pattern1;
89    int fg;
90    int bg;
91    FBAreaPtr offscreenArea;
92    Bool freeData;
93} XAAPixmapRec, *XAAPixmapPtr;
94
95
96extern _X_EXPORT Bool
97XAACreateGC(
98    GCPtr pGC
99);
100
101extern _X_EXPORT Bool
102XAAInitAccel(
103    ScreenPtr pScreen,
104    XAAInfoRecPtr infoRec
105);
106
107extern _X_EXPORT RegionPtr
108XAABitBlt(
109    DrawablePtr pSrcDrawable,
110    DrawablePtr pDstDrawable,
111    GC *pGC,
112    int srcx,
113    int srcy,
114    int width,
115    int height,
116    int dstx,
117    int dsty,
118    void (*doBitBlt)(DrawablePtr, DrawablePtr, GCPtr, RegionPtr, DDXPointPtr),
119    unsigned long bitPlane
120);
121
122extern _X_EXPORT void
123XAAScreenToScreenBitBlt(
124    ScrnInfoPtr pScrn,
125    int nbox,
126    DDXPointPtr pptSrc,
127    BoxPtr pbox,
128    int xdir,
129    int ydir,
130    int alu,
131    unsigned int planemask
132);
133
134extern _X_EXPORT void
135XAADoBitBlt(
136    DrawablePtr	    pSrc,
137    DrawablePtr     pDst,
138    GC		    *pGC,
139    RegionPtr	    prgnDst,
140    DDXPointPtr	    pptSrc
141);
142
143extern _X_EXPORT void
144XAADoImageWrite(
145    DrawablePtr	    pSrc,
146    DrawablePtr     pDst,
147    GC		    *pGC,
148    RegionPtr	    prgnDst,
149    DDXPointPtr	    pptSrc
150);
151
152extern _X_EXPORT void
153XAADoImageRead(
154    DrawablePtr     pSrc,
155    DrawablePtr     pDst,
156    GC              *pGC,
157    RegionPtr       prgnDst,
158    DDXPointPtr     pptSrc
159);
160
161extern _X_EXPORT void
162XAACopyWindow(
163    WindowPtr pWin,
164    DDXPointRec ptOldOrg,
165    RegionPtr prgnSrc
166);
167
168
169extern _X_EXPORT RegionPtr
170XAACopyArea(
171    DrawablePtr pSrcDrawable,
172    DrawablePtr pDstDrawable,
173    GC *pGC,
174    int srcx,
175    int srcy,
176    int width,
177    int height,
178    int dstx,
179    int dsty
180);
181
182extern _X_EXPORT void
183XAAValidateCopyArea(
184   GCPtr         pGC,
185   unsigned long changes,
186   DrawablePtr   pDraw
187);
188
189extern _X_EXPORT void
190XAAValidatePutImage(
191   GCPtr         pGC,
192   unsigned long changes,
193   DrawablePtr   pDraw
194);
195
196extern _X_EXPORT void
197XAAValidateCopyPlane(
198   GCPtr         pGC,
199   unsigned long changes,
200   DrawablePtr   pDraw
201);
202
203extern _X_EXPORT void
204XAAValidatePushPixels(
205   GCPtr         pGC,
206   unsigned long changes,
207   DrawablePtr   pDraw
208);
209
210extern _X_EXPORT void
211XAAValidateFillSpans(
212   GCPtr         pGC,
213   unsigned long changes,
214   DrawablePtr   pDraw
215);
216
217extern _X_EXPORT void
218XAAValidatePolyGlyphBlt(
219   GCPtr         pGC,
220   unsigned long changes,
221   DrawablePtr   pDraw
222);
223
224extern _X_EXPORT void
225XAAValidateImageGlyphBlt(
226   GCPtr         pGC,
227   unsigned long changes,
228   DrawablePtr   pDraw
229);
230
231extern _X_EXPORT void
232XAAValidatePolylines(
233   GCPtr         pGC,
234   unsigned long changes,
235   DrawablePtr   pDraw
236);
237
238
239extern _X_EXPORT RegionPtr
240XAACopyPlaneColorExpansion(
241    DrawablePtr		pSrc,
242    DrawablePtr		pDst,
243    GCPtr		pGC,
244    int			srcx,
245    int			srcy,
246    int			width,
247    int			height,
248    int			dstx,
249    int			dsty,
250    unsigned long	bitPlane
251);
252
253
254extern _X_EXPORT void
255XAAPushPixelsSolidColorExpansion(
256    GCPtr	pGC,
257    PixmapPtr	pBitMap,
258    DrawablePtr pDrawable,
259    int		dx,
260    int		dy,
261    int		xOrg,
262    int		yOrg
263);
264
265extern _X_EXPORT void
266XAAWriteBitmapColorExpandMSBFirstFixedBase (
267    ScrnInfoPtr pScrn,
268    int x, int y, int w, int h,
269    unsigned char *src,
270    int srcwidth,
271    int skipleft,
272    int fg, int bg,
273    int rop,
274    unsigned int planemask
275);
276
277extern _X_EXPORT void
278XAAWriteBitmapColorExpand3MSBFirstFixedBase (
279    ScrnInfoPtr pScrn,
280    int x, int y, int w, int h,
281    unsigned char *src,
282    int srcwidth,
283    int skipleft,
284    int fg, int bg,
285    int rop,
286    unsigned int planemask
287);
288
289extern _X_EXPORT void
290XAAWriteBitmapColorExpandMSBFirst (
291    ScrnInfoPtr pScrn,
292    int x, int y, int w, int h,
293    unsigned char *src,
294    int srcwidth,
295    int skipleft,
296    int fg, int bg,
297    int rop,
298    unsigned int planemask
299);
300
301extern _X_EXPORT void
302XAAWriteBitmapColorExpand3MSBFirst (
303    ScrnInfoPtr pScrn,
304    int x, int y, int w, int h,
305    unsigned char *src,
306    int srcwidth,
307    int skipleft,
308    int fg, int bg,
309    int rop,
310    unsigned int planemask
311);
312
313extern _X_EXPORT void
314XAAWriteBitmapColorExpandLSBFirstFixedBase (
315    ScrnInfoPtr pScrn,
316    int x, int y, int w, int h,
317    unsigned char *src,
318    int srcwidth,
319    int skipleft,
320    int fg, int bg,
321    int rop,
322    unsigned int planemask
323);
324
325extern _X_EXPORT void
326XAAWriteBitmapColorExpand3LSBFirstFixedBase (
327    ScrnInfoPtr pScrn,
328    int x, int y, int w, int h,
329    unsigned char *src,
330    int srcwidth,
331    int skipleft,
332    int fg, int bg,
333    int rop,
334    unsigned int planemask
335);
336
337extern _X_EXPORT void
338XAAWriteBitmapColorExpandLSBFirst (
339    ScrnInfoPtr pScrn,
340    int x, int y, int w, int h,
341    unsigned char *src,
342    int srcwidth,
343    int skipleft,
344    int fg, int bg,
345    int rop,
346    unsigned int planemask
347);
348
349extern _X_EXPORT void
350XAAWriteBitmapColorExpand3LSBFirst (
351    ScrnInfoPtr pScrn,
352    int x, int y, int w, int h,
353    unsigned char *src,
354    int srcwidth,
355    int skipleft,
356    int fg, int bg,
357    int rop,
358    unsigned int planemask
359);
360
361
362extern _X_EXPORT void
363XAAWriteBitmapScanlineColorExpandMSBFirst (
364    ScrnInfoPtr pScrn,
365    int x, int y, int w, int h,
366    unsigned char *src,
367    int srcwidth,
368    int skipleft,
369    int fg, int bg,
370    int rop,
371    unsigned int planemask
372);
373
374extern _X_EXPORT void
375XAAWriteBitmapScanlineColorExpand3MSBFirst (
376    ScrnInfoPtr pScrn,
377    int x, int y, int w, int h,
378    unsigned char *src,
379    int srcwidth,
380    int skipleft,
381    int fg, int bg,
382    int rop,
383    unsigned int planemask
384);
385
386extern _X_EXPORT void
387XAAWriteBitmapScanlineColorExpandMSBFirstFixedBase (
388    ScrnInfoPtr pScrn,
389    int x, int y, int w, int h,
390    unsigned char *src,
391    int srcwidth,
392    int skipleft,
393    int fg, int bg,
394    int rop,
395    unsigned int planemask
396);
397
398extern _X_EXPORT void
399XAAWriteBitmapScanlineColorExpand3MSBFirstFixedBase (
400    ScrnInfoPtr pScrn,
401    int x, int y, int w, int h,
402    unsigned char *src,
403    int srcwidth,
404    int skipleft,
405    int fg, int bg,
406    int rop,
407    unsigned int planemask
408);
409
410extern _X_EXPORT void
411XAAWriteBitmapScanlineColorExpandLSBFirst (
412    ScrnInfoPtr pScrn,
413    int x, int y, int w, int h,
414    unsigned char *src,
415    int srcwidth,
416    int skipleft,
417    int fg, int bg,
418    int rop,
419    unsigned int planemask
420);
421
422extern _X_EXPORT void
423XAAWriteBitmapScanlineColorExpand3LSBFirst (
424    ScrnInfoPtr pScrn,
425    int x, int y, int w, int h,
426    unsigned char *src,
427    int srcwidth,
428    int skipleft,
429    int fg, int bg,
430    int rop,
431    unsigned int planemask
432);
433
434extern _X_EXPORT void
435XAAWriteBitmapScanlineColorExpandLSBFirstFixedBase (
436    ScrnInfoPtr pScrn,
437    int x, int y, int w, int h,
438    unsigned char *src,
439    int srcwidth,
440    int skipleft,
441    int fg, int bg,
442    int rop,
443    unsigned int planemask
444);
445
446extern _X_EXPORT void
447XAAWriteBitmapScanlineColorExpand3LSBFirstFixedBase (
448    ScrnInfoPtr pScrn,
449    int x, int y, int w, int h,
450    unsigned char *src,
451    int srcwidth,
452    int skipleft,
453    int fg, int bg,
454    int rop,
455    unsigned int planemask
456);
457
458extern _X_EXPORT void
459XAAWritePixmap (
460   ScrnInfoPtr pScrn,
461   int x, int y, int w, int h,
462   unsigned char *src,
463   int srcwidth,
464   int rop,
465   unsigned int planemask,
466   int transparency_color,
467   int bpp, int depth
468);
469
470extern _X_EXPORT void
471XAAWritePixmapScanline (
472   ScrnInfoPtr pScrn,
473   int x, int y, int w, int h,
474   unsigned char *src,
475   int srcwidth,
476   int rop,
477   unsigned int planemask,
478   int transparency_color,
479   int bpp, int depth
480);
481
482typedef void (*ClipAndRenderRectsFunc)(GCPtr, int, BoxPtr, int, int);
483
484
485extern _X_EXPORT void
486XAAClipAndRenderRects(
487   GCPtr pGC,
488   ClipAndRenderRectsFunc func,
489   int nrectFill,
490   xRectangle *prectInit,
491   int xorg, int yorg
492);
493
494
495typedef void (*ClipAndRenderSpansFunc)(GCPtr, int, DDXPointPtr, int*,
496							int, int, int);
497
498extern _X_EXPORT void
499XAAClipAndRenderSpans(
500    GCPtr pGC,
501    DDXPointPtr	ppt,
502    int		*pwidth,
503    int		nspans,
504    int		fSorted,
505    ClipAndRenderSpansFunc func,
506    int 	xorg,
507    int		yorg
508);
509
510
511extern _X_EXPORT void
512XAAFillSolidRects(
513    ScrnInfoPtr pScrn,
514    int fg, int rop,
515    unsigned int planemask,
516    int		nBox,
517    BoxPtr	pBox
518);
519
520extern _X_EXPORT void
521XAAFillMono8x8PatternRects(
522    ScrnInfoPtr pScrn,
523    int	fg, int bg, int rop,
524    unsigned int planemask,
525    int	nBox,
526    BoxPtr pBox,
527    int pat0, int pat1,
528    int xorg, int yorg
529);
530
531extern _X_EXPORT void
532XAAFillMono8x8PatternRectsScreenOrigin(
533    ScrnInfoPtr pScrn,
534    int	fg, int bg, int rop,
535    unsigned int planemask,
536    int	nBox,
537    BoxPtr pBox,
538    int pat0, int pat1,
539    int xorg, int yorg
540);
541
542
543extern _X_EXPORT void
544XAAFillColor8x8PatternRectsScreenOrigin(
545   ScrnInfoPtr pScrn,
546   int rop,
547   unsigned int planemask,
548   int nBox,
549   BoxPtr pBox,
550   int xorigin, int yorigin,
551   XAACacheInfoPtr pCache
552);
553
554extern _X_EXPORT void
555XAAFillColor8x8PatternRects(
556   ScrnInfoPtr pScrn,
557   int rop,
558   unsigned int planemask,
559   int nBox,
560   BoxPtr pBox,
561   int xorigin, int yorigin,
562   XAACacheInfoPtr pCache
563);
564
565extern _X_EXPORT void
566XAAFillCacheBltRects(
567   ScrnInfoPtr pScrn,
568   int rop,
569   unsigned int planemask,
570   int nBox,
571   BoxPtr pBox,
572   int xorg, int yorg,
573   XAACacheInfoPtr pCache
574);
575
576extern _X_EXPORT void
577XAAFillCacheExpandRects(
578   ScrnInfoPtr pScrn,
579   int fg, int bg, int rop,
580   unsigned int planemask,
581   int nBox,
582   BoxPtr pBox,
583   int xorg, int yorg,
584   PixmapPtr pPix
585);
586
587extern _X_EXPORT void
588XAAFillImageWriteRects(
589    ScrnInfoPtr pScrn,
590    int rop,
591    unsigned int planemask,
592    int nBox,
593    BoxPtr pBox,
594    int xorg, int yorg,
595    PixmapPtr pPix
596);
597
598void
599XAAFillScanlineImageWriteRects(
600    ScrnInfoPtr pScrn,
601    int rop,
602    unsigned int planemask,
603    int nBox,
604    BoxPtr pBox,
605    int xorg, int yorg,
606    PixmapPtr pPix
607);
608
609extern _X_EXPORT void
610XAAPolyFillRect(
611    DrawablePtr pDraw,
612    GCPtr pGC,
613    int	nrectFill,
614    xRectangle *prectInit
615);
616
617
618extern _X_EXPORT void
619XAATEGlyphRendererMSBFirstFixedBase (
620    ScrnInfoPtr pScrn,
621    int x, int y, int w, int h, int skipleft, int startline,
622    unsigned int **glyphs, int glyphWidth,
623    int fg, int bg, int rop, unsigned planemask
624);
625
626extern _X_EXPORT void
627XAATEGlyphRenderer3MSBFirstFixedBase (
628    ScrnInfoPtr pScrn,
629    int x, int y, int w, int h, int skipleft, int startline,
630    unsigned int **glyphs, int glyphWidth,
631    int fg, int bg, int rop, unsigned planemask
632);
633
634extern _X_EXPORT void
635XAATEGlyphRendererMSBFirst (
636    ScrnInfoPtr pScrn,
637    int x, int y, int w, int h, int skipleft, int startline,
638    unsigned int **glyphs, int glyphWidth,
639    int fg, int bg, int rop, unsigned planemask
640);
641
642extern _X_EXPORT void
643XAATEGlyphRenderer3MSBFirst (
644    ScrnInfoPtr pScrn,
645    int x, int y, int w, int h, int skipleft, int startline,
646    unsigned int **glyphs, int glyphWidth,
647    int fg, int bg, int rop, unsigned planemask
648);
649
650extern _X_EXPORT void
651XAATEGlyphRendererLSBFirstFixedBase (
652    ScrnInfoPtr pScrn,
653    int x, int y, int w, int h, int skipleft, int startline,
654    unsigned int **glyphs, int glyphWidth,
655    int fg, int bg, int rop, unsigned planemask
656);
657
658
659extern _X_EXPORT void
660XAATEGlyphRenderer3LSBFirstFixedBase (
661    ScrnInfoPtr pScrn,
662    int x, int y, int w, int h, int skipleft, int startline,
663    unsigned int **glyphs, int glyphWidth,
664    int fg, int bg, int rop, unsigned planemask
665);
666
667extern _X_EXPORT void
668XAATEGlyphRendererLSBFirst (
669    ScrnInfoPtr pScrn,
670    int x, int y, int w, int h, int skipleft, int startline,
671    unsigned int **glyphs, int glyphWidth,
672    int fg, int bg, int rop, unsigned planemask
673);
674
675extern _X_EXPORT void
676XAATEGlyphRenderer3LSBFirst (
677    ScrnInfoPtr pScrn,
678    int x, int y, int w, int h, int skipleft, int startline,
679    unsigned int **glyphs, int glyphWidth,
680    int fg, int bg, int rop, unsigned planemask
681);
682
683
684extern _X_EXPORT void
685XAATEGlyphRendererScanlineMSBFirst (
686    ScrnInfoPtr pScrn,
687    int x, int y, int w, int h, int skipleft, int startline,
688    unsigned int **glyphs, int glyphWidth,
689    int fg, int bg, int rop, unsigned planemask
690);
691
692extern _X_EXPORT void
693XAATEGlyphRendererScanline3MSBFirst (
694    ScrnInfoPtr pScrn,
695    int x, int y, int w, int h, int skipleft, int startline,
696    unsigned int **glyphs, int glyphWidth,
697    int fg, int bg, int rop, unsigned planemask
698);
699
700extern _X_EXPORT void
701XAATEGlyphRendererScanlineLSBFirst (
702    ScrnInfoPtr pScrn,
703    int x, int y, int w, int h, int skipleft, int startline,
704    unsigned int **glyphs, int glyphWidth,
705    int fg, int bg, int rop, unsigned planemask
706);
707
708extern _X_EXPORT void
709XAATEGlyphRendererScanline3LSBFirst (
710    ScrnInfoPtr pScrn,
711    int x, int y, int w, int h, int skipleft, int startline,
712    unsigned int **glyphs, int glyphWidth,
713    int fg, int bg, int rop, unsigned planemask
714);
715
716
717extern _X_EXPORT CARD32 *(*XAAGlyphScanlineFuncMSBFirstFixedBase[32])(
718   CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
719);
720
721extern _X_EXPORT CARD32 *(*XAAGlyphScanlineFuncMSBFirst[32])(
722   CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
723);
724
725extern _X_EXPORT CARD32 *(*XAAGlyphScanlineFuncLSBFirstFixedBase[32])(
726   CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
727);
728
729extern _X_EXPORT CARD32 *(*XAAGlyphScanlineFuncLSBFirst[32])(
730   CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
731);
732
733extern _X_EXPORT GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncMSBFirstFixedBase(void);
734extern _X_EXPORT GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncMSBFirst(void);
735extern _X_EXPORT GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncLSBFirstFixedBase(void);
736extern _X_EXPORT GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncLSBFirst(void);
737
738extern _X_EXPORT void
739XAAFillColorExpandRectsLSBFirst(
740   ScrnInfoPtr pScrn,
741   int fg, int bg, int rop,
742   unsigned int planemask,
743   int nBox,
744   BoxPtr pBox,
745   int xorg, int yorg,
746   PixmapPtr pPix
747);
748
749extern _X_EXPORT void
750XAAFillColorExpandRects3LSBFirst(
751   ScrnInfoPtr pScrn,
752   int fg, int bg, int rop,
753   unsigned int planemask,
754   int nBox,
755   BoxPtr pBox,
756   int xorg, int yorg,
757   PixmapPtr pPix
758);
759
760extern _X_EXPORT void
761XAAFillColorExpandRectsLSBFirstFixedBase(
762   ScrnInfoPtr pScrn,
763   int fg, int bg, int rop,
764   unsigned int planemask,
765   int nBox,
766   BoxPtr pBox,
767   int xorg, int yorg,
768   PixmapPtr pPix
769);
770
771extern _X_EXPORT void
772XAAFillColorExpandRects3LSBFirstFixedBase(
773   ScrnInfoPtr pScrn,
774   int fg, int bg, int rop,
775   unsigned int planemask,
776   int nBox,
777   BoxPtr pBox,
778   int xorg, int yorg,
779   PixmapPtr pPix
780);
781
782extern _X_EXPORT void
783XAAFillColorExpandRectsMSBFirst(
784   ScrnInfoPtr pScrn,
785   int fg, int bg, int rop,
786   unsigned int planemask,
787   int nBox,
788   BoxPtr pBox,
789   int xorg, int yorg,
790   PixmapPtr pPix
791);
792
793extern _X_EXPORT void
794XAAFillColorExpandRects3MSBFirst(
795   ScrnInfoPtr pScrn,
796   int fg, int bg, int rop,
797   unsigned int planemask,
798   int nBox,
799   BoxPtr pBox,
800   int xorg, int yorg,
801   PixmapPtr pPix
802);
803
804extern _X_EXPORT void
805XAAFillColorExpandRectsMSBFirstFixedBase(
806   ScrnInfoPtr pScrn,
807   int fg, int bg, int rop,
808   unsigned int planemask,
809   int nBox,
810   BoxPtr pBox,
811   int xorg, int yorg,
812   PixmapPtr pPix
813);
814
815extern _X_EXPORT void
816XAAFillColorExpandRects3MSBFirstFixedBase(
817   ScrnInfoPtr pScrn,
818   int fg, int bg, int rop,
819   unsigned int planemask,
820   int nBox,
821   BoxPtr pBox,
822   int xorg, int yorg,
823   PixmapPtr pPix
824);
825
826extern _X_EXPORT void
827XAAFillScanlineColorExpandRectsLSBFirst(
828   ScrnInfoPtr pScrn,
829   int fg, int bg, int rop,
830   unsigned int planemask,
831   int nBox,
832   BoxPtr pBox,
833   int xorg, int yorg,
834   PixmapPtr pPix
835);
836
837extern _X_EXPORT void
838XAAFillScanlineColorExpandRects3LSBFirst(
839   ScrnInfoPtr pScrn,
840   int fg, int bg, int rop,
841   unsigned int planemask,
842   int nBox,
843   BoxPtr pBox,
844   int xorg, int yorg,
845   PixmapPtr pPix
846);
847
848extern _X_EXPORT void
849XAAFillScanlineColorExpandRectsMSBFirst(
850   ScrnInfoPtr pScrn,
851   int fg, int bg, int rop,
852   unsigned int planemask,
853   int nBox,
854   BoxPtr pBox,
855   int xorg, int yorg,
856   PixmapPtr pPix
857);
858
859extern _X_EXPORT void
860XAAFillScanlineColorExpandRects3MSBFirst(
861   ScrnInfoPtr pScrn,
862   int fg, int bg, int rop,
863   unsigned int planemask,
864   int nBox,
865   BoxPtr pBox,
866   int xorg, int yorg,
867   PixmapPtr pPix
868);
869
870extern _X_EXPORT void
871XAAFillColorExpandSpansLSBFirst(
872   ScrnInfoPtr pScrn,
873   int fg, int bg, int rop,
874   unsigned int planemask,
875   int n,
876   DDXPointPtr ppt,
877   int *pwidth,
878   int fSorted,
879   int xorg, int yorg,
880   PixmapPtr pPix
881);
882
883extern _X_EXPORT void
884XAAFillColorExpandSpans3LSBFirst(
885   ScrnInfoPtr pScrn,
886   int fg, int bg, int rop,
887   unsigned int planemask,
888   int n,
889   DDXPointPtr ppt,
890   int *pwidth,
891   int fSorted,
892   int xorg, int yorg,
893   PixmapPtr pPix
894);
895
896extern _X_EXPORT void
897XAAFillColorExpandSpansLSBFirstFixedBase(
898   ScrnInfoPtr pScrn,
899   int fg, int bg, int rop,
900   unsigned int planemask,
901   int n,
902   DDXPointPtr ppt,
903   int *pwidth,
904   int fSorted,
905   int xorg, int yorg,
906   PixmapPtr pPix
907);
908
909extern _X_EXPORT void
910XAAFillColorExpandSpans3LSBFirstFixedBase(
911   ScrnInfoPtr pScrn,
912   int fg, int bg, int rop,
913   unsigned int planemask,
914   int n,
915   DDXPointPtr ppt,
916   int *pwidth,
917   int fSorted,
918   int xorg, int yorg,
919   PixmapPtr pPix
920);
921
922extern _X_EXPORT void
923XAAFillColorExpandSpansMSBFirst(
924   ScrnInfoPtr pScrn,
925   int fg, int bg, int rop,
926   unsigned int planemask,
927   int n,
928   DDXPointPtr ppt,
929   int *pwidth,
930   int fSorted,
931   int xorg, int yorg,
932   PixmapPtr pPix
933);
934
935extern _X_EXPORT void
936XAAFillColorExpandSpans3MSBFirst(
937   ScrnInfoPtr pScrn,
938   int fg, int bg, int rop,
939   unsigned int planemask,
940   int n,
941   DDXPointPtr ppt,
942   int *pwidth,
943   int fSorted,
944   int xorg, int yorg,
945   PixmapPtr pPix
946);
947
948extern _X_EXPORT void
949XAAFillColorExpandSpansMSBFirstFixedBase(
950   ScrnInfoPtr pScrn,
951   int fg, int bg, int rop,
952   unsigned int planemask,
953   int n,
954   DDXPointPtr ppt,
955   int *pwidth,
956   int fSorted,
957   int xorg, int yorg,
958   PixmapPtr pPix
959);
960
961extern _X_EXPORT void
962XAAFillColorExpandSpans3MSBFirstFixedBase(
963   ScrnInfoPtr pScrn,
964   int fg, int bg, int rop,
965   unsigned int planemask,
966   int n,
967   DDXPointPtr ppt,
968   int *pwidth,
969   int fSorted,
970   int xorg, int yorg,
971   PixmapPtr pPix
972);
973
974extern _X_EXPORT void
975XAAFillScanlineColorExpandSpansLSBFirst(
976   ScrnInfoPtr pScrn,
977   int fg, int bg, int rop,
978   unsigned int planemask,
979   int n,
980   DDXPointPtr ppt,
981   int *pwidth,
982   int fSorted,
983   int xorg, int yorg,
984   PixmapPtr pPix
985);
986
987extern _X_EXPORT void
988XAAFillScanlineColorExpandSpans3LSBFirst(
989   ScrnInfoPtr pScrn,
990   int fg, int bg, int rop,
991   unsigned int planemask,
992   int n,
993   DDXPointPtr ppt,
994   int *pwidth,
995   int fSorted,
996   int xorg, int yorg,
997   PixmapPtr pPix
998);
999
1000extern _X_EXPORT void
1001XAAPutImage(
1002    DrawablePtr pDraw,
1003    GCPtr       pGC,
1004    int         depth,
1005    int 	x,
1006    int		y,
1007    int		w,
1008    int		h,
1009    int         leftPad,
1010    int         format,
1011    char        *pImage
1012);
1013
1014extern _X_EXPORT void
1015XAAFillScanlineColorExpandSpansMSBFirst(
1016   ScrnInfoPtr pScrn,
1017   int fg, int bg, int rop,
1018   unsigned int planemask,
1019   int n,
1020   DDXPointPtr ppt,
1021   int *pwidth,
1022   int fSorted,
1023   int xorg, int yorg,
1024   PixmapPtr pPix
1025);
1026
1027extern _X_EXPORT void
1028XAAFillScanlineColorExpandSpans3MSBFirst(
1029   ScrnInfoPtr pScrn,
1030   int fg, int bg, int rop,
1031   unsigned int planemask,
1032   int n,
1033   DDXPointPtr ppt,
1034   int *pwidth,
1035   int fSorted,
1036   int xorg, int yorg,
1037   PixmapPtr pPix
1038);
1039
1040
1041extern _X_EXPORT CARD32 *(*XAAStippleScanlineFuncMSBFirstFixedBase[6])(
1042   CARD32* base, CARD32* src, int offset, int width, int dwords
1043);
1044
1045extern _X_EXPORT CARD32 *(*XAAStippleScanlineFuncMSBFirst[6])(
1046   CARD32* base, CARD32* src, int offset, int width, int dwords
1047);
1048
1049extern _X_EXPORT CARD32 *(*XAAStippleScanlineFuncLSBFirstFixedBase[6])(
1050   CARD32* base, CARD32* src, int offset, int width, int dwords
1051);
1052
1053extern _X_EXPORT CARD32 *(*XAAStippleScanlineFuncLSBFirst[6])(
1054   CARD32* base, CARD32* src, int offset, int width, int dwords
1055);
1056
1057extern _X_EXPORT StippleScanlineProcPtr *XAAGetStippleScanlineFuncMSBFirstFixedBase(void);
1058extern _X_EXPORT StippleScanlineProcPtr *XAAGetStippleScanlineFuncMSBFirst(void);
1059extern _X_EXPORT StippleScanlineProcPtr *XAAGetStippleScanlineFuncLSBFirstFixedBase(void);
1060extern _X_EXPORT StippleScanlineProcPtr *XAAGetStippleScanlineFuncLSBFirst(void);
1061extern _X_EXPORT StippleScanlineProcPtr *XAAGetStippleScanlineFunc3MSBFirstFixedBase(void);
1062extern _X_EXPORT StippleScanlineProcPtr *XAAGetStippleScanlineFunc3MSBFirst(void);
1063extern _X_EXPORT StippleScanlineProcPtr *XAAGetStippleScanlineFunc3LSBFirstFixedBase(void);
1064extern _X_EXPORT StippleScanlineProcPtr *XAAGetStippleScanlineFunc3LSBFirst(void);
1065
1066extern _X_EXPORT int
1067XAAPolyText8TEColorExpansion(
1068    DrawablePtr pDraw,
1069    GCPtr pGC,
1070    int	x, int y,
1071    int count,
1072    char *chars
1073);
1074
1075extern _X_EXPORT int
1076XAAPolyText16TEColorExpansion(
1077    DrawablePtr pDraw,
1078    GCPtr pGC,
1079    int	x, int y,
1080    int count,
1081    unsigned short *chars
1082);
1083
1084extern _X_EXPORT void
1085XAAImageText8TEColorExpansion(
1086    DrawablePtr pDraw,
1087    GCPtr pGC,
1088    int	x, int y,
1089    int count,
1090    char *chars
1091);
1092
1093extern _X_EXPORT void
1094XAAImageText16TEColorExpansion(
1095    DrawablePtr pDraw,
1096    GCPtr pGC,
1097    int	x, int y,
1098    int count,
1099    unsigned short *chars
1100);
1101
1102extern _X_EXPORT void
1103XAAImageGlyphBltTEColorExpansion(
1104    DrawablePtr pDrawable,
1105    GCPtr pGC,
1106    int xInit, int yInit,
1107    unsigned int nglyph,
1108    CharInfoPtr *ppci,
1109    pointer pglyphBase
1110);
1111
1112extern _X_EXPORT void
1113XAAPolyGlyphBltTEColorExpansion(
1114    DrawablePtr pDrawable,
1115    GCPtr pGC,
1116    int xInit, int yInit,
1117    unsigned int nglyph,
1118    CharInfoPtr *ppci,
1119    pointer pglyphBase
1120);
1121
1122
1123extern _X_EXPORT int
1124XAAPolyText8NonTEColorExpansion(
1125    DrawablePtr pDraw,
1126    GCPtr pGC,
1127    int	x, int y,
1128    int count,
1129    char *chars
1130);
1131
1132extern _X_EXPORT int
1133XAAPolyText16NonTEColorExpansion(
1134    DrawablePtr pDraw,
1135    GCPtr pGC,
1136    int	x, int y,
1137    int count,
1138    unsigned short *chars
1139);
1140
1141extern _X_EXPORT void
1142XAAImageText8NonTEColorExpansion(
1143    DrawablePtr pDraw,
1144    GCPtr pGC,
1145    int	x, int y,
1146    int count,
1147    char *chars
1148);
1149
1150extern _X_EXPORT void
1151XAAImageText16NonTEColorExpansion(
1152    DrawablePtr pDraw,
1153    GCPtr pGC,
1154    int	x, int y,
1155    int count,
1156    unsigned short *chars
1157);
1158
1159extern _X_EXPORT void
1160XAAImageGlyphBltNonTEColorExpansion(
1161    DrawablePtr pDrawable,
1162    GCPtr pGC,
1163    int xInit, int yInit,
1164    unsigned int nglyph,
1165    CharInfoPtr *ppci,
1166    pointer pglyphBase
1167);
1168
1169extern _X_EXPORT void
1170XAAPolyGlyphBltNonTEColorExpansion(
1171    DrawablePtr pDrawable,
1172    GCPtr pGC,
1173    int xInit, int yInit,
1174    unsigned int nglyph,
1175    CharInfoPtr *ppci,
1176    pointer pglyphBase
1177);
1178
1179
1180extern _X_EXPORT void XAANonTEGlyphRenderer(
1181   ScrnInfoPtr pScrn,
1182   int x, int y, int n,
1183   NonTEGlyphPtr glyphs,
1184   BoxPtr pbox,
1185   int fg, int rop,
1186   unsigned int planemask
1187);
1188
1189extern _X_EXPORT void
1190XAAFillSolidSpans(
1191   ScrnInfoPtr pScrn,
1192   int fg, int rop,
1193   unsigned int planemask,
1194   int n,
1195   DDXPointPtr ppt,
1196   int *pwidth, int fSorted
1197);
1198
1199extern _X_EXPORT void
1200XAAFillMono8x8PatternSpans(
1201   ScrnInfoPtr pScrn,
1202   int fg, int bg, int rop,
1203   unsigned int planemask,
1204   int n,
1205   DDXPointPtr ppt,
1206   int *pwidth, int fSorted,
1207   int patx, int paty,
1208   int xorg, int yorg
1209);
1210
1211extern _X_EXPORT void
1212XAAFillMono8x8PatternSpansScreenOrigin(
1213   ScrnInfoPtr pScrn,
1214   int fg, int bg, int rop,
1215   unsigned int planemask,
1216   int n,
1217   DDXPointPtr ppt,
1218   int *pwidth, int fSorted,
1219   int patx, int paty,
1220   int xorg, int yorg
1221);
1222
1223extern _X_EXPORT void
1224XAAFillColor8x8PatternSpansScreenOrigin(
1225   ScrnInfoPtr pScrn,
1226   int rop,
1227   unsigned int planemask,
1228   int n,
1229   DDXPointPtr ppt,
1230   int *pwidth, int fSorted,
1231   XAACacheInfoPtr,
1232   int xorigin, int yorigin
1233);
1234
1235extern _X_EXPORT void
1236XAAFillColor8x8PatternSpans(
1237   ScrnInfoPtr pScrn,
1238   int rop,
1239   unsigned int planemask,
1240   int n,
1241   DDXPointPtr ppt,
1242   int *pwidth, int fSorted,
1243   XAACacheInfoPtr,
1244   int xorigin, int yorigin
1245);
1246
1247extern _X_EXPORT void
1248XAAFillCacheBltSpans(
1249   ScrnInfoPtr pScrn,
1250   int rop,
1251   unsigned int planemask,
1252   int n,
1253   DDXPointPtr points,
1254   int *widths,
1255   int fSorted,
1256   XAACacheInfoPtr pCache,
1257   int xorg, int yorg
1258);
1259
1260extern _X_EXPORT void
1261XAAFillCacheExpandSpans(
1262   ScrnInfoPtr pScrn,
1263   int fg, int bg, int rop,
1264   unsigned int planemask,
1265   int n,
1266   DDXPointPtr ppt,
1267   int *pwidth,
1268   int fSorted,
1269   int xorg, int yorg,
1270   PixmapPtr pPix
1271);
1272
1273extern _X_EXPORT void
1274XAAFillSpans(
1275    DrawablePtr pDrawable,
1276    GC		*pGC,
1277    int		nInit,
1278    DDXPointPtr pptInit,
1279    int *pwidth,
1280    int fSorted
1281);
1282
1283
1284extern _X_EXPORT void
1285XAAInitPixmapCache(
1286    ScreenPtr pScreen,
1287    RegionPtr areas,
1288    pointer data
1289);
1290
1291extern _X_EXPORT void
1292XAAWriteBitmapToCache(
1293   ScrnInfoPtr pScrn,
1294   int x, int y, int w, int h,
1295   unsigned char *src,
1296   int srcwidth,
1297   int fg, int bg
1298);
1299
1300extern _X_EXPORT void
1301XAAWriteBitmapToCacheLinear(
1302   ScrnInfoPtr pScrn,
1303   int x, int y, int w, int h,
1304   unsigned char *src,
1305   int srcwidth,
1306   int fg, int bg
1307);
1308
1309extern _X_EXPORT void
1310XAAWritePixmapToCache(
1311   ScrnInfoPtr pScrn,
1312   int x, int y, int w, int h,
1313   unsigned char *src,
1314   int srcwidth,
1315   int bpp, int depth
1316);
1317
1318extern _X_EXPORT void
1319XAAWritePixmapToCacheLinear(
1320   ScrnInfoPtr pScrn,
1321   int x, int y, int w, int h,
1322   unsigned char *src,
1323   int srcwidth,
1324   int bpp, int depth
1325);
1326
1327extern _X_EXPORT void
1328XAASolidHorVertLineAsRects(
1329   ScrnInfoPtr pScrn,
1330   int x, int y, int len, int dir
1331);
1332
1333extern _X_EXPORT void
1334XAASolidHorVertLineAsTwoPoint(
1335   ScrnInfoPtr pScrn,
1336   int x, int y, int len, int dir
1337);
1338
1339extern _X_EXPORT void
1340XAASolidHorVertLineAsBresenham(
1341   ScrnInfoPtr pScrn,
1342   int x, int y, int len, int dir
1343);
1344
1345
1346extern _X_EXPORT void
1347XAAPolyRectangleThinSolid(
1348    DrawablePtr  pDrawable,
1349    GCPtr        pGC,
1350    int	         nRectsInit,
1351    xRectangle  *pRectsInit
1352);
1353
1354
1355extern _X_EXPORT void
1356XAAPolylinesWideSolid (
1357   DrawablePtr	pDrawable,
1358   GCPtr	pGC,
1359   int		mode,
1360   int 		npt,
1361   DDXPointPtr	pPts
1362);
1363
1364extern _X_EXPORT void
1365XAAFillPolygonSolid(
1366    DrawablePtr	pDrawable,
1367    GCPtr	pGC,
1368    int		shape,
1369    int		mode,
1370    int		count,
1371    DDXPointPtr	ptsIn
1372);
1373
1374extern _X_EXPORT void
1375XAAFillPolygonStippled(
1376    DrawablePtr	pDrawable,
1377    GCPtr	pGC,
1378    int		shape,
1379    int		mode,
1380    int		count,
1381    DDXPointPtr	ptsIn
1382);
1383
1384
1385extern _X_EXPORT void
1386XAAFillPolygonTiled(
1387    DrawablePtr	pDrawable,
1388    GCPtr	pGC,
1389    int		shape,
1390    int		mode,
1391    int		count,
1392    DDXPointPtr	ptsIn
1393);
1394
1395
1396extern _X_EXPORT int
1397XAAIsEasyPolygon(
1398   DDXPointPtr ptsIn,
1399   int count,
1400   BoxPtr extents,
1401   int origin,
1402   DDXPointPtr *topPoint,
1403   int *topY, int *bottomY,
1404   int shape
1405);
1406
1407extern _X_EXPORT void
1408XAAFillPolygonHelper(
1409    ScrnInfoPtr pScrn,
1410    DDXPointPtr	ptsIn,
1411    int 	count,
1412    DDXPointPtr topPoint,
1413    int 	y,
1414    int		maxy,
1415    int		origin,
1416    RectFuncPtr RectFunc,
1417    TrapFuncPtr TrapFunc,
1418    int 	xorg,
1419    int		yorg,
1420    XAACacheInfoPtr pCache
1421);
1422
1423extern _X_EXPORT void
1424XAAPolySegment(
1425    DrawablePtr	pDrawable,
1426    GCPtr	pGC,
1427    int		nseg,
1428    xSegment	*pSeg
1429);
1430
1431extern _X_EXPORT void
1432XAAPolyLines(
1433    DrawablePtr pDrawable,
1434    GCPtr	pGC,
1435    int		mode,
1436    int		npt,
1437    DDXPointPtr pptInit
1438);
1439
1440extern _X_EXPORT void
1441XAAPolySegmentDashed(
1442    DrawablePtr	pDrawable,
1443    GCPtr	pGC,
1444    int		nseg,
1445    xSegment	*pSeg
1446);
1447
1448extern _X_EXPORT void
1449XAAPolyLinesDashed(
1450    DrawablePtr pDrawable,
1451    GCPtr	pGC,
1452    int		mode,
1453    int		npt,
1454    DDXPointPtr pptInit
1455);
1456
1457
1458extern _X_EXPORT void
1459XAAWriteMono8x8PatternToCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache);
1460
1461extern _X_EXPORT void
1462XAAWriteColor8x8PatternToCache(
1463   ScrnInfoPtr pScrn,
1464   PixmapPtr pPix,
1465   XAACacheInfoPtr pCache
1466);
1467
1468extern _X_EXPORT void
1469XAARotateMonoPattern(
1470    int *pat0, int *pat1,
1471    int xoffset, int yoffset,
1472    Bool msbfirst
1473);
1474
1475extern _X_EXPORT void XAAComputeDash(GCPtr pGC);
1476
1477extern _X_EXPORT void XAAMoveDWORDS_FixedBase(
1478   register CARD32* dest,
1479   register CARD32* src,
1480   register int dwords
1481);
1482
1483extern _X_EXPORT void XAAMoveDWORDS_FixedSrc(
1484   register CARD32* dest,
1485   register CARD32* src,
1486   register int dwords
1487);
1488
1489extern _X_EXPORT void XAAMoveDWORDS(
1490   register CARD32* dest,
1491   register CARD32* src,
1492   register int dwords
1493);
1494
1495extern _X_EXPORT int
1496XAAGetRectClipBoxes(
1497    GCPtr pGC,
1498    BoxPtr pboxClippedBase,
1499    int nrectFill,
1500    xRectangle *prectInit
1501);
1502
1503extern _X_EXPORT void
1504XAASetupOverlay8_32Planar(ScreenPtr);
1505
1506extern _X_EXPORT void
1507XAAPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs);
1508
1509extern _X_EXPORT XAACacheInfoPtr
1510XAACacheTile(ScrnInfoPtr Scrn, PixmapPtr pPix);
1511
1512extern _X_EXPORT XAACacheInfoPtr
1513XAACacheMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix);
1514
1515extern _X_EXPORT XAACacheInfoPtr
1516XAACachePlanarMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix);
1517
1518typedef XAACacheInfoPtr (*XAACachePlanarMonoStippleProc)(ScrnInfoPtr, PixmapPtr);
1519extern _X_EXPORT XAACachePlanarMonoStippleProc XAAGetCachePlanarMonoStipple(void);
1520
1521extern _X_EXPORT XAACacheInfoPtr
1522XAACacheStipple(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg, int bg);
1523
1524extern _X_EXPORT XAACacheInfoPtr
1525XAACacheMono8x8Pattern(ScrnInfoPtr Scrn, int pat0, int pat1);
1526
1527extern _X_EXPORT XAACacheInfoPtr
1528XAACacheColor8x8Pattern(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg, int bg);
1529
1530extern _X_EXPORT void
1531XAATileCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache, int w, int h);
1532
1533extern _X_EXPORT void XAAClosePixmapCache(ScreenPtr pScreen);
1534void XAAInvalidatePixmapCache(ScreenPtr pScreen);
1535
1536extern _X_EXPORT Bool XAACheckStippleReducibility(PixmapPtr pPixmap);
1537extern _X_EXPORT Bool XAACheckTileReducibility(PixmapPtr pPixmap, Bool checkMono);
1538
1539extern _X_EXPORT int XAAStippledFillChooser(GCPtr pGC);
1540extern _X_EXPORT int XAAOpaqueStippledFillChooser(GCPtr pGC);
1541extern _X_EXPORT int XAATiledFillChooser(GCPtr pGC);
1542
1543extern _X_EXPORT void XAAMoveInOffscreenPixmaps(ScreenPtr pScreen);
1544extern _X_EXPORT void XAAMoveOutOffscreenPixmaps(ScreenPtr pScreen);
1545extern _X_EXPORT void XAARemoveAreaCallback(FBAreaPtr area);
1546extern _X_EXPORT void XAAMoveOutOffscreenPixmap(PixmapPtr pPix);
1547extern _X_EXPORT Bool XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec);
1548
1549extern _X_EXPORT void
1550XAAComposite (CARD8      op,
1551	      PicturePtr pSrc,
1552	      PicturePtr pMask,
1553	      PicturePtr pDst,
1554	      INT16      xSrc,
1555	      INT16      ySrc,
1556	      INT16      xMask,
1557	      INT16      yMask,
1558	      INT16      xDst,
1559	      INT16      yDst,
1560	      CARD16     width,
1561	      CARD16     height);
1562
1563
1564extern _X_EXPORT Bool
1565XAADoComposite (CARD8      op,
1566              PicturePtr pSrc,
1567              PicturePtr pMask,
1568              PicturePtr pDst,
1569              INT16      xSrc,
1570              INT16      ySrc,
1571              INT16      xMask,
1572              INT16      yMask,
1573              INT16      xDst,
1574              INT16      yDst,
1575              CARD16     width,
1576              CARD16     height);
1577
1578
1579extern _X_EXPORT void
1580XAAGlyphs (CARD8         op,
1581	   PicturePtr    pSrc,
1582	   PicturePtr    pDst,
1583	   PictFormatPtr maskFormat,
1584	   INT16         xSrc,
1585	   INT16         ySrc,
1586	   int           nlist,
1587	   GlyphListPtr  list,
1588	   GlyphPtr      *glyphs);
1589
1590extern _X_EXPORT Bool
1591XAADoGlyphs (CARD8         op,
1592           PicturePtr    pSrc,
1593           PicturePtr    pDst,
1594           PictFormatPtr maskFormat,
1595           INT16         xSrc,
1596           INT16         ySrc,
1597           int           nlist,
1598           GlyphListPtr  list,
1599           GlyphPtr      *glyphs);
1600
1601
1602
1603/* helpers */
1604extern _X_EXPORT void
1605XAA_888_plus_PICT_a8_to_8888 (
1606    CARD32 color,
1607    CARD8  *alphaPtr,   /* in bytes */
1608    int    alphaPitch,
1609    CARD32  *dstPtr,
1610    int    dstPitch,	/* in dwords */
1611    int    width,
1612    int    height
1613);
1614
1615extern _X_EXPORT Bool
1616XAAGetRGBAFromPixel(
1617    CARD32 pixel,
1618    CARD16 *red,
1619    CARD16 *green,
1620    CARD16 *blue,
1621    CARD16 *alpha,
1622    CARD32 format
1623);
1624
1625
1626extern _X_EXPORT Bool
1627XAAGetPixelFromRGBA (
1628    CARD32 *pixel,
1629    CARD16 red,
1630    CARD16 green,
1631    CARD16 blue,
1632    CARD16 alpha,
1633    CARD32 format
1634);
1635
1636/* XXX should be static */
1637extern _X_EXPORT GCOps XAAFallbackOps;
1638extern _X_EXPORT GCOps *XAAGetFallbackOps(void);
1639extern _X_EXPORT GCFuncs XAAGCFuncs;
1640extern _X_EXPORT DevPrivateKey XAAGetScreenKey(void);
1641extern _X_EXPORT DevPrivateKey XAAGetGCKey(void);
1642extern _X_EXPORT DevPrivateKey XAAGetPixmapKey(void);
1643
1644extern _X_EXPORT unsigned int XAAShiftMasks[32];
1645
1646extern _X_EXPORT unsigned int byte_expand3[256], byte_reversed_expand3[256];
1647
1648extern _X_EXPORT CARD32 XAAReverseBitOrder(CARD32 data);
1649
1650#define GET_XAASCREENPTR_FROM_SCREEN(pScreen)\
1651    dixLookupPrivate(&(pScreen)->devPrivates, XAAGetScreenKey())
1652
1653#define GET_XAASCREENPTR_FROM_GC(pGC)\
1654    dixLookupPrivate(&(pGC)->pScreen->devPrivates, XAAGetScreenKey())
1655
1656#define GET_XAASCREENPTR_FROM_DRAWABLE(pDraw)\
1657    dixLookupPrivate(&(pDraw)->pScreen->devPrivates, XAAGetScreenKey())
1658
1659#define GET_XAAINFORECPTR_FROM_SCREEN(pScreen)\
1660((XAAScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, XAAGetScreenKey()))->AccelInfoRec
1661
1662#define GET_XAAINFORECPTR_FROM_GC(pGC)\
1663((XAAScreenPtr)dixLookupPrivate(&(pGC)->pScreen->devPrivates, XAAGetScreenKey()))->AccelInfoRec
1664
1665#define GET_XAAINFORECPTR_FROM_DRAWABLE(pDraw)\
1666((XAAScreenPtr)dixLookupPrivate(&(pDraw)->pScreen->devPrivates, XAAGetScreenKey()))->AccelInfoRec
1667
1668#define GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn)\
1669((XAAScreenPtr)dixLookupPrivate(&(pScrn)->pScreen->devPrivates, XAAGetScreenKey()))->AccelInfoRec
1670
1671#define XAA_GET_PIXMAP_PRIVATE(pix)\
1672    (XAAPixmapPtr)dixLookupPrivate(&(pix)->devPrivates, XAAGetPixmapKey())
1673
1674#define CHECK_RGB_EQUAL(c) (!((((c) >> 8) ^ (c)) & 0xffff))
1675
1676#define CHECK_FG(pGC, flags) \
1677	(!(flags & RGB_EQUAL) || CHECK_RGB_EQUAL(pGC->fgPixel))
1678
1679#define CHECK_BG(pGC, flags) \
1680	(!(flags & RGB_EQUAL) || CHECK_RGB_EQUAL(pGC->bgPixel))
1681
1682#define CHECK_ROP(pGC, flags) \
1683	(!(flags & GXCOPY_ONLY) || (pGC->alu == GXcopy))
1684
1685#define CHECK_ROPSRC(pGC, flags) \
1686	(!(flags & ROP_NEEDS_SOURCE) || ((pGC->alu != GXclear) && \
1687	(pGC->alu != GXnoop) && (pGC->alu != GXinvert) && \
1688	(pGC->alu != GXset)))
1689
1690#define CHECK_PLANEMASK(pGC, flags) \
1691	(!(flags & NO_PLANEMASK) || \
1692	((pGC->planemask & infoRec->FullPlanemasks[pGC->depth - 1]) == \
1693          infoRec->FullPlanemasks[pGC->depth - 1]))
1694
1695#define CHECK_COLORS(pGC, flags) \
1696	(!(flags & RGB_EQUAL) || \
1697	(CHECK_RGB_EQUAL(pGC->fgPixel) && CHECK_RGB_EQUAL(pGC->bgPixel)))
1698
1699#define CHECK_NO_GXCOPY(pGC, flags) \
1700	((pGC->alu != GXcopy) || !(flags & NO_GXCOPY) || \
1701	((pGC->planemask & infoRec->FullPlanemask) != infoRec->FullPlanemask))
1702
1703#define IS_OFFSCREEN_PIXMAP(pPix)\
1704        ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->offscreenArea)
1705
1706#define PIXMAP_IS_SCREEN(pDraw)\
1707        (pDraw == (void *)pDraw->pScreen->GetScreenPixmap(pDraw->pScreen))
1708
1709#define PIXMAP_IS_SHARED(pPix)\
1710        ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->flags & SHARED_PIXMAP)
1711
1712#define OFFSCREEN_PIXMAP_LOCKED(pPix)\
1713        ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->flags & LOCKED_PIXMAP)
1714
1715#define XAA_DEPTH_BUG(pGC) \
1716        ((pGC->depth == 32) && (pGC->bgPixel == 0xffffffff))
1717
1718#define DELIST_OFFSCREEN_PIXMAP(pPix) { \
1719	PixmapLinkPtr _pLink, _prev; \
1720	_pLink = infoRec->OffscreenPixmaps; \
1721	_prev = NULL; \
1722	while(_pLink) { \
1723	    if(_pLink->pPix == pPix) { \
1724		if(_prev) _prev->next = _pLink->next; \
1725		else infoRec->OffscreenPixmaps = _pLink->next; \
1726		free(_pLink); \
1727		break; \
1728	    } \
1729	    _prev = _pLink; \
1730	    _pLink = _pLink->next; \
1731        }}
1732
1733
1734#define SWAP_BITS_IN_BYTES(v) \
1735 (((0x01010101 & (v)) << 7) | ((0x02020202 & (v)) << 5) | \
1736  ((0x04040404 & (v)) << 3) | ((0x08080808 & (v)) << 1) | \
1737  ((0x10101010 & (v)) >> 1) | ((0x20202020 & (v)) >> 3) | \
1738  ((0x40404040 & (v)) >> 5) | ((0x80808080 & (v)) >> 7))
1739
1740/*
1741 * Moved XAAPixmapCachePrivate here from xaaPCache.c, since driver
1742 * replacements for CacheMonoStipple need access to it
1743 */
1744
1745typedef struct {
1746   int Num512x512;
1747   int Current512;
1748   XAACacheInfoPtr Info512;
1749   int Num256x256;
1750   int Current256;
1751   XAACacheInfoPtr Info256;
1752   int Num128x128;
1753   int Current128;
1754   XAACacheInfoPtr Info128;
1755   int NumMono;
1756   int CurrentMono;
1757   XAACacheInfoPtr InfoMono;
1758   int NumColor;
1759   int CurrentColor;
1760   XAACacheInfoPtr InfoColor;
1761   int NumPartial;
1762   int CurrentPartial;
1763   XAACacheInfoPtr InfoPartial;
1764   DDXPointRec MonoOffsets[64];
1765   DDXPointRec ColorOffsets[64];
1766} XAAPixmapCachePrivate, *XAAPixmapCachePrivatePtr;
1767
1768
1769#endif /* _XAALOCAL_H */
1770