initial commit
[profile/ivi/xorg-x11-server.git] / hw / xfree86 / xaa / xaa.h
1
2 #ifndef _XAA_H
3 #define _XAA_H
4
5 #define XAA_VERSION_MAJOR   1
6 #define XAA_VERSION_MINOR   2
7 #define XAA_VERSION_RELEASE 1
8
9 /*
10
11    ******** OPERATION SPECIFIC FLAGS *********
12
13    **** solid/dashed line flags ****
14  
15 ---------               --------
16 23           LINE_PATTERN_LSBFIRST_MSBJUSTIFIED
17 22           LINE_PATTERN_LSBFIRST_LSBJUSTIFIED
18 21           LINE_PATTERN_MSBFIRST_MSBJUSTIFIED
19 20           LINE_PATTERN_MSBFIRST_LSBJUSTIFIED
20 19           LINE_PATTERN_POWER_OF_2_ONLY
21 18           LINE_LIMIT_COORDS
22 17                         .
23 16                         .
24 ---------               -------
25
26    **** screen to screen copy flags ****
27
28 ---------               --------
29 23           ONLY_LEFT_TO_RIGHT_BITBLT
30 22           ONLY_TWO_BITBLT_DIRECTIONS
31 21                         .
32 20                         .
33 19                         .
34 18                         .
35 17                         .
36 16                         .
37 ---------               -------
38
39    ****  clipping flags ****
40
41 ---------               --------
42 23                         .
43 22           HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND
44 21           HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY
45 20           HARDWARE_CLIP_MONO_8x8_FILL
46 19           HARDWARE_CLIP_COLOR_8x8_FILL    
47 18           HARDWARE_CLIP_SOLID_FILL
48 17           HARDWARE_CLIP_DASHED_LINE
49 16           HARDWARE_CLIP_SOLID_LINE
50 ---------               -------
51
52
53    ****  hardware pattern flags ****
54
55 ---------               --------
56 23                         .
57 22                         .
58 21           HARDWARE_PATTERN_SCREEN_ORIGIN
59 20                         .
60 19                         .
61 18                         .
62 17           HARDWARE_PATTERN_PROGRAMMED_ORIGIN
63 16           HARDWARE_PATTERN_PROGRAMMED_BITS
64 ---------               -------
65
66    ****  write pixmap flags ****
67
68 ---------               --------
69 23                         .
70 22                         .
71 21                         .
72 20                         .
73 19                         .
74 18                         .
75 17                         .
76 16           CONVERT_32BPP_TO_24BPP
77 ---------               -------
78
79
80    ******** GENERIC FLAGS *********
81
82 ---------               -------
83 15           SYNC_AFTER_COLOR_EXPAND
84 14           CPU_TRANSFER_PAD_QWORD
85 13                         .
86 12           LEFT_EDGE_CLIPPING_NEGATIVE_X
87 11           LEFT_EDGE_CLIPPING
88 10           CPU_TRANSFER_BASE_FIXED
89  9           BIT_ORDER_IN_BYTE_MSBFIRST           
90  8           TRANSPARENCY_GXCOPY_ONLY
91 ---------               -------
92  7           NO_TRANSPARENCY
93  6           TRANSPARENCY_ONLY
94  5           ROP_NEEDS_SOURCE
95  4           TRIPLE_BITS_24BPP
96  3           RGB_EQUAL
97  2           NO_PLANEMASK
98  1           NO_GXCOPY
99  0           GXCOPY_ONLY
100 ---------               -------
101
102
103 */
104
105 #include "gcstruct.h"
106 #include "pixmapstr.h"
107 #include "xf86str.h"
108 #include "regionstr.h"
109 #include "xf86fbman.h"
110
111 #include "picturestr.h"
112
113 /* Flags */
114 #define PIXMAP_CACHE                    0x00000001
115 #define MICROSOFT_ZERO_LINE_BIAS        0x00000002
116 #define OFFSCREEN_PIXMAPS               0x00000004
117 #define LINEAR_FRAMEBUFFER              0x00000008
118
119
120 /* GC fg, bg, and planemask restrictions */
121 #define GXCOPY_ONLY                     0x00000001
122 #define NO_GXCOPY                       0x00000002
123 #define NO_PLANEMASK                    0x00000004
124 #define RGB_EQUAL                       0x00000008
125 #define TRIPLE_BITS_24BPP               0x00000010
126 #define ROP_NEEDS_SOURCE                0x00000020
127
128 /* transparency restrictions */
129 #define TRANSPARENCY_ONLY               0x00000040
130 #define NO_TRANSPARENCY                 0x00000080
131 #define TRANSPARENCY_GXCOPY_ONLY        0x00000100
132
133 /* bit order restrictions */
134 #define BIT_ORDER_IN_BYTE_MSBFIRST      0x00000200
135 #define BIT_ORDER_IN_BYTE_LSBFIRST      0x00000000
136
137 /* transfer base restriction */
138 #define CPU_TRANSFER_BASE_FIXED         0x00000400
139
140 /* skipleft restrictions */
141 #define LEFT_EDGE_CLIPPING              0x00000800
142 #define LEFT_EDGE_CLIPPING_NEGATIVE_X   0x00001000
143
144 /* data padding */
145 #define CPU_TRANSFER_PAD_DWORD          0x00000000
146 #define CPU_TRANSFER_PAD_QWORD          0x00004000
147 #define SCANLINE_PAD_DWORD              0x00000000
148
149 #define SYNC_AFTER_COLOR_EXPAND         0x00008000
150 #define SYNC_AFTER_IMAGE_WRITE          SYNC_AFTER_COLOR_EXPAND
151
152 /* hardware pattern */
153 #define HARDWARE_PATTERN_PROGRAMMED_BITS        0x00010000
154 #define HARDWARE_PATTERN_PROGRAMMED_ORIGIN      0x00020000
155 #define HARDWARE_PATTERN_SCREEN_ORIGIN          0x00200000
156
157 /* copyarea flags */
158 #define ONLY_TWO_BITBLT_DIRECTIONS      0x00400000
159 #define ONLY_LEFT_TO_RIGHT_BITBLT       0x00800000
160
161 /* line flags */
162 #define LINE_PATTERN_LSBFIRST_MSBJUSTIFIED      0x00800000
163 #define LINE_PATTERN_LSBFIRST_LSBJUSTIFIED      0x00400000
164 #define LINE_PATTERN_MSBFIRST_MSBJUSTIFIED      0x00200000
165 #define LINE_PATTERN_MSBFIRST_LSBJUSTIFIED      0x00100000
166 #define LINE_PATTERN_POWER_OF_2_ONLY            0x00080000
167 #define LINE_LIMIT_COORDS                       0x00040000
168
169 /* clipping flags */
170 #define HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND     0x00400000
171 #define HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY             0x00200000
172 #define HARDWARE_CLIP_MONO_8x8_FILL                     0x00100000
173 #define HARDWARE_CLIP_COLOR_8x8_FILL                    0x00080000
174 #define HARDWARE_CLIP_SOLID_FILL                        0x00040000
175 #define HARDWARE_CLIP_DASHED_LINE                       0x00020000
176 #define HARDWARE_CLIP_SOLID_LINE                        0x00010000
177
178 #define HARDWARE_CLIP_LINE                              0x00000000
179
180
181 /* image write flags */
182 #define CONVERT_32BPP_TO_24BPP                  0x00010000
183
184 /* pixmap cache flags */
185 #define CACHE_MONO_8x8                  0x00000001
186 #define CACHE_COLOR_8x8                 0x00000002
187 #define DO_NOT_BLIT_STIPPLES            0x00000004
188 #define DO_NOT_TILE_MONO_DATA           0x00000008      
189 #define DO_NOT_TILE_COLOR_DATA          0x00000010
190
191
192 #define DEGREES_0       0
193 #define DEGREES_90      1
194 #define DEGREES_180     2
195 #define DEGREES_270     3
196
197 #define OMIT_LAST       1
198
199 /* render flags */
200
201 #define XAA_RENDER_POWER_OF_2_TILE_ONLY 0x00000008
202 #define XAA_RENDER_NO_SRC_ALPHA         0x00000004
203 #define XAA_RENDER_IMPRECISE_ONLY       0x00000002      
204 #define XAA_RENDER_NO_TILE              0x00000001              
205
206 #define XAA_RENDER_REPEAT               0x00000001
207
208 typedef void (* ValidateGCProcPtr)(
209    GCPtr         pGC,
210    unsigned long changes,
211    DrawablePtr   pDraw
212 );
213
214 typedef struct {
215     unsigned char *bits;
216     int width;
217     int height;
218     int yoff;
219     int srcwidth;
220     int start;
221     int end;
222 } NonTEGlyphInfo, *NonTEGlyphPtr;
223
224
225 typedef struct {
226    int x;
227    int y;
228    int w;
229    int h;
230    int orig_w;
231    int orig_h;
232    unsigned long serialNumber;
233    int pat0;
234    int pat1;
235    int fg;
236    int bg;
237    int trans_color;
238    DDXPointPtr offsets;
239    DevUnion devPrivate;
240 } XAACacheInfoRec, *XAACacheInfoPtr;
241
242
243 typedef struct _PixmapLink {
244   PixmapPtr pPix;
245   struct _PixmapLink *next;
246   FBAreaPtr area;
247 } PixmapLink, *PixmapLinkPtr;
248
249 typedef struct _XAAInfoRec {
250    ScrnInfoPtr pScrn;
251    int Flags;
252
253    void (*Sync)(
254         ScrnInfoPtr pScrn
255    );
256    
257    /* Restore Accel State is a driver callback that is used
258     * when another screen on the same device has been active.
259     * This allows multihead on a single device to work.
260     * If The entityProp has IS_SHARED_ACCEL defined then this
261     * function is required.
262     */
263    
264    void (*RestoreAccelState)(
265         ScrnInfoPtr pScrn
266    );
267
268    /***************** Low Level *****************/
269
270 /* Blits */
271    void (*SetupForScreenToScreenCopy)(
272         ScrnInfoPtr pScrn,
273         int xdir, int ydir,
274         int rop,
275         unsigned int planemask,
276         int trans_color
277    );
278    int ScreenToScreenCopyFlags;
279
280    void (*SubsequentScreenToScreenCopy)(
281         ScrnInfoPtr pScrn,
282         int xsrc, int ysrc,
283         int xdst, int ydst,
284         int w, int h
285    );
286
287    
288 /* Solid fills */
289    void (*SetupForSolidFill)(
290         ScrnInfoPtr pScrn,
291         int color,
292         int rop,
293         unsigned int planemask
294    );    
295    int SolidFillFlags;  
296
297    void (*SubsequentSolidFillRect)(
298         ScrnInfoPtr pScrn,
299         int x, int y, int w, int h
300    );    
301
302    void (*SubsequentSolidFillTrap)(
303         ScrnInfoPtr pScrn,
304         int y, int h, 
305         int left, int dxL, int dyL, int eL,
306         int right, int dxR, int dyR, int eR
307    );
308
309
310 /* Solid lines */
311
312    void (*SetupForSolidLine)(
313         ScrnInfoPtr pScrn,
314         int color,
315         int rop,
316         unsigned int planemask
317    );    
318    int SolidLineFlags;  
319
320    void (*SubsequentSolidTwoPointLine)(
321         ScrnInfoPtr pScrn,
322         int xa, int ya, int xb, int yb, int flags
323    );   
324
325    void (*SubsequentSolidBresenhamLine)(
326         ScrnInfoPtr pScrn,
327         int x, int y, int absmaj, int absmin, int err, int len, int octant
328    );   
329    int SolidBresenhamLineErrorTermBits;
330
331    void (*SubsequentSolidHorVertLine)(
332         ScrnInfoPtr pScrn,
333         int x, int y, int len, int dir
334    );   
335
336 /* Dashed lines */
337
338    void (*SetupForDashedLine)(
339         ScrnInfoPtr pScrn,
340         int fg, int bg,
341         int rop,
342         unsigned int planemask,
343         int length,
344         unsigned char *pattern
345    );    
346    int DashedLineFlags; 
347    int DashPatternMaxLength; 
348
349    void (*SubsequentDashedTwoPointLine)(
350         ScrnInfoPtr pScrn,
351         int xa, int ya, int xb, int yb, int flags, int phase
352    );   
353
354    void (*SubsequentDashedBresenhamLine)(
355         ScrnInfoPtr pScrn,
356         int x, int y, int absmaj, int absmin, int err, int len, int flags,
357         int phase
358    );   
359    int DashedBresenhamLineErrorTermBits;
360
361 /* Clipper */
362
363    void (*SetClippingRectangle) (
364         ScrnInfoPtr pScrn,
365         int left, int top, int right, int bottom
366    );
367    int ClippingFlags;
368
369    void (*DisableClipping)(ScrnInfoPtr pScrn);
370
371 /* 8x8 mono pattern fills */
372    void (*SetupForMono8x8PatternFill)(
373         ScrnInfoPtr pScrn,
374         int patx, int paty,
375         int fg, int bg,
376         int rop,
377         unsigned int planemask
378    );
379    int Mono8x8PatternFillFlags; 
380
381    void (*SubsequentMono8x8PatternFillRect)(
382         ScrnInfoPtr pScrn,
383         int patx, int paty,
384         int x, int y, int w, int h
385    );
386
387    void (*SubsequentMono8x8PatternFillTrap)(
388         ScrnInfoPtr pScrn,
389         int patx, int paty,
390         int y, int h, 
391         int left, int dxL, int dyL, int eL,
392         int right, int dxR, int dyR, int eR
393    );
394
395 /* 8x8 color pattern fills */
396
397    void (*SetupForColor8x8PatternFill)(
398         ScrnInfoPtr pScrn,
399         int patx, int paty,
400         int rop,
401         unsigned int planemask,
402         int transparency_color
403    );
404    int Color8x8PatternFillFlags; 
405
406    void (*SubsequentColor8x8PatternFillRect)(
407         ScrnInfoPtr pScrn,
408         int patx, int paty,
409         int x, int y, int w, int h
410    );
411
412    void (*SubsequentColor8x8PatternFillTrap)(
413         ScrnInfoPtr pScrn,
414         int patx, int paty,
415         int y, int h, 
416         int left, int dxL, int dyL, int eL,
417         int right, int dxR, int dyR, int eR
418    );
419
420
421 /* Color expansion */
422
423    void (*SetupForCPUToScreenColorExpandFill)(
424         ScrnInfoPtr pScrn,
425         int fg, int bg,
426         int rop,
427         unsigned int planemask
428    );     
429    int CPUToScreenColorExpandFillFlags;  
430
431    void (*SubsequentCPUToScreenColorExpandFill)(
432         ScrnInfoPtr pScrn,
433         int x, int y, int w, int h,
434         int skipleft
435    );
436
437    unsigned char *ColorExpandBase;
438    int ColorExpandRange;
439
440
441 /* Scanline color expansion  */
442
443    void (*SetupForScanlineCPUToScreenColorExpandFill)(
444         ScrnInfoPtr pScrn,
445         int fg, int bg,
446         int rop,
447         unsigned int planemask
448    );  
449    int ScanlineCPUToScreenColorExpandFillFlags;
450
451    void (*SubsequentScanlineCPUToScreenColorExpandFill)(
452         ScrnInfoPtr pScrn,
453         int x, int y, int w, int h,
454         int skipleft
455    );
456
457    void (*SubsequentColorExpandScanline)(
458         ScrnInfoPtr pScrn,
459         int bufno
460    );
461
462    int NumScanlineColorExpandBuffers;
463    unsigned char **ScanlineColorExpandBuffers;
464
465 /* Screen to screen color expansion */
466
467    void (*SetupForScreenToScreenColorExpandFill) (
468         ScrnInfoPtr pScrn,
469         int fg, int bg,
470         int rop,
471         unsigned int planemask
472    );
473    int ScreenToScreenColorExpandFillFlags;
474
475    void (*SubsequentScreenToScreenColorExpandFill)(
476         ScrnInfoPtr pScrn,
477         int x, int y, int w, int h,
478         int srcx, int srcy, int skipleft
479    );
480    
481
482 /*  Image transfers */
483
484    void (*SetupForImageWrite)(
485         ScrnInfoPtr pScrn,
486         int rop,
487         unsigned int planemask,
488         int transparency_color,
489         int bpp, int depth
490    );
491    int ImageWriteFlags;
492
493    void (*SubsequentImageWriteRect)(
494         ScrnInfoPtr pScrn,
495         int x, int y, int w, int h,
496         int skipleft
497    );
498    unsigned char *ImageWriteBase;
499    int ImageWriteRange;
500         
501 /*  Scanline Image transfers */
502
503    void (*SetupForScanlineImageWrite)(
504         ScrnInfoPtr pScrn,
505         int rop,
506         unsigned int planemask,
507         int transparency_color,
508         int bpp, int depth
509    );
510    int ScanlineImageWriteFlags;
511
512    void (*SubsequentScanlineImageWriteRect)(
513         ScrnInfoPtr pScrn,
514         int x, int y, int w, int h,
515         int skipleft
516    );
517
518    void (*SubsequentImageWriteScanline) (
519         ScrnInfoPtr pScrn,
520         int bufno
521    );
522    
523    int NumScanlineImageWriteBuffers;
524    unsigned char **ScanlineImageWriteBuffers;
525
526   /* Image Reads - OBSOLETE AND NOT USED */
527
528    void (*SetupForImageRead) (
529         ScrnInfoPtr pScrn,
530         int bpp, int depth
531    );
532    int ImageReadFlags;
533
534    unsigned char *ImageReadBase;
535    int ImageReadRange;
536
537    void (*SubsequentImageReadRect)(
538         ScrnInfoPtr pScrn,
539         int x, int y, int w, int h
540    );  
541
542
543    /***************** Mid Level *****************/
544    void (*ScreenToScreenBitBlt)(
545         ScrnInfoPtr pScrn,
546         int nbox,
547         DDXPointPtr pptSrc,
548         BoxPtr pbox,
549         int xdir, int ydir,
550         int alu,
551         unsigned int planmask
552    );
553    int ScreenToScreenBitBltFlags;
554
555    void (*WriteBitmap) (
556         ScrnInfoPtr pScrn,
557         int x, int y, int w, int h,
558         unsigned char *src,
559         int srcwidth,
560         int skipleft,
561         int fg, int bg,
562         int rop,
563         unsigned int planemask
564    );
565    int WriteBitmapFlags;
566
567    void (*FillSolidRects)(
568         ScrnInfoPtr pScrn,
569         int fg, int rop,
570         unsigned int planemask,
571         int nBox,
572         BoxPtr pBox 
573    );
574    int FillSolidRectsFlags;
575
576    void (*FillMono8x8PatternRects)(
577         ScrnInfoPtr pScrn,
578         int fg, int bg, int rop,
579         unsigned int planemask,
580         int nBox,
581         BoxPtr pBox, 
582         int pat0, int pat1,
583         int xorg, int yorg
584    );
585    int FillMono8x8PatternRectsFlags;
586
587    void (*FillColor8x8PatternRects)(
588         ScrnInfoPtr pScrn,
589         int rop,
590         unsigned int planemask,
591         int nBox,
592         BoxPtr pBox,
593         int xorg, int yorg,
594         XAACacheInfoPtr pCache
595    );
596    int FillColor8x8PatternRectsFlags;
597
598    void (*FillCacheBltRects)(
599         ScrnInfoPtr pScrn,
600         int rop,
601         unsigned int planemask,
602         int nBox,
603         BoxPtr pBox,
604         int xorg, int yorg,
605         XAACacheInfoPtr pCache
606    );
607    int FillCacheBltRectsFlags;
608
609    void (*FillColorExpandRects)(
610         ScrnInfoPtr pScrn,
611         int fg, int bg, int rop,
612         unsigned int planemask,
613         int nBox,
614         BoxPtr pBox,
615         int xorg, int yorg,
616         PixmapPtr pPix
617    );
618    int FillColorExpandRectsFlags;
619
620    void (*FillCacheExpandRects)(
621         ScrnInfoPtr pScrn,
622         int fg, int bg, int rop,
623         unsigned int planemask,
624         int nBox,
625         BoxPtr pBox,
626         int xorg, int yorg,
627         PixmapPtr pPix
628    );
629    int FillCacheExpandRectsFlags;
630
631    void (*FillImageWriteRects)(
632         ScrnInfoPtr pScrn,
633         int rop,
634         unsigned int planemask,
635         int nBox,
636         BoxPtr pBox,
637         int xorg, int yorg,
638         PixmapPtr pPix
639    );
640    int FillImageWriteRectsFlags;
641    
642
643    void (*FillSolidSpans)(
644         ScrnInfoPtr pScrn,
645         int fg, int rop,
646         unsigned int planemask,
647         int n,
648         DDXPointPtr points,
649         int *widths,
650         int fSorted 
651    );
652    int FillSolidSpansFlags;
653
654    void (*FillMono8x8PatternSpans)(
655         ScrnInfoPtr pScrn,
656         int fg, int bg, int rop,
657         unsigned int planemask,
658         int n,
659         DDXPointPtr points,
660         int *widths,
661         int fSorted, 
662         int pat0, int pat1,
663         int xorg, int yorg
664    );
665    int FillMono8x8PatternSpansFlags;
666
667    void (*FillColor8x8PatternSpans)(
668         ScrnInfoPtr pScrn,
669         int rop,
670         unsigned int planemask,
671         int n,
672         DDXPointPtr points,
673         int *widths,
674         int fSorted,
675         XAACacheInfoPtr pCache,
676         int xorg, int yorg
677    );
678    int FillColor8x8PatternSpansFlags;
679
680    void (*FillCacheBltSpans)(
681         ScrnInfoPtr pScrn,
682         int rop,
683         unsigned int planemask,
684         int n,
685         DDXPointPtr points,
686         int *widths,
687         int fSorted,
688         XAACacheInfoPtr pCache,
689         int xorg, int yorg
690    );
691    int FillCacheBltSpansFlags;
692
693    void (*FillColorExpandSpans)(
694         ScrnInfoPtr pScrn,
695         int fg, int bg, int rop,
696         unsigned int planemask,
697         int n,
698         DDXPointPtr points,
699         int *widths,
700         int fSorted,
701         int xorg, int yorg,
702         PixmapPtr pPix
703    );
704    int FillColorExpandSpansFlags;
705
706    void (*FillCacheExpandSpans)(
707         ScrnInfoPtr pScrn,
708         int fg, int bg, int rop,
709         unsigned int planemask,
710         int n,
711         DDXPointPtr ppt,
712         int *pwidth,
713         int fSorted,
714         int xorg, int yorg,
715         PixmapPtr pPix
716    );
717    int FillCacheExpandSpansFlags;
718
719    void (*TEGlyphRenderer)(
720         ScrnInfoPtr pScrn,
721         int x, int y, int w, int h, int skipleft, int startline, 
722         unsigned int **glyphs, int glyphWidth,
723         int fg, int bg, int rop, unsigned planemask
724    );
725    int TEGlyphRendererFlags;
726
727    void (*NonTEGlyphRenderer)(
728         ScrnInfoPtr pScrn,
729         int x, int y, int n,
730         NonTEGlyphPtr glyphs,
731         BoxPtr pbox,
732         int fg, int rop,
733         unsigned int planemask
734    );
735    int NonTEGlyphRendererFlags;
736
737    void (*WritePixmap) (
738         ScrnInfoPtr pScrn,
739         int x, int y, int w, int h,
740         unsigned char *src,
741         int srcwidth,
742         int rop,
743         unsigned int planemask,
744         int transparency_color,
745         int bpp, int depth
746    );
747    int WritePixmapFlags;
748
749    void (*ReadPixmap) (
750         ScrnInfoPtr pScrn,
751         int x, int y, int w, int h,
752         unsigned char *dst,     
753         int dstwidth,
754         int bpp, int depth
755    );
756    int ReadPixmapFlags;
757
758    /***************** GC Level *****************/
759    RegionPtr (*CopyArea)(
760         DrawablePtr pSrcDrawable,
761         DrawablePtr pDstDrawable,
762         GC *pGC,
763         int srcx, int srcy,
764         int width, int height,
765         int dstx, int dsty
766    );
767    int CopyAreaFlags;
768
769    RegionPtr (*CopyPlane)(
770         DrawablePtr pSrc,
771         DrawablePtr pDst,
772         GCPtr pGC,
773         int srcx, int srcy,
774         int width, int height,
775         int dstx, int dsty,
776         unsigned long bitPlane
777    );
778    int CopyPlaneFlags;
779
780    void (*PushPixelsSolid) (
781         GCPtr   pGC,
782         PixmapPtr pBitMap,
783         DrawablePtr pDrawable,
784         int dx, int dy, 
785         int xOrg, int yOrg
786    );
787    int PushPixelsFlags; 
788
789    /** PolyFillRect **/
790
791    void (*PolyFillRectSolid)(
792         DrawablePtr pDraw,
793         GCPtr pGC,
794         int nrectFill,  
795         xRectangle *prectInit
796    );  
797    int PolyFillRectSolidFlags;
798
799    void (*PolyFillRectStippled)(
800         DrawablePtr pDraw,
801         GCPtr pGC,
802         int nrectFill,  
803         xRectangle *prectInit
804    );  
805    int PolyFillRectStippledFlags;
806
807    void (*PolyFillRectOpaqueStippled)(
808         DrawablePtr pDraw,
809         GCPtr pGC,
810         int nrectFill,  
811         xRectangle *prectInit
812    );  
813    int PolyFillRectOpaqueStippledFlags;
814
815    void (*PolyFillRectTiled)(
816         DrawablePtr pDraw,
817         GCPtr pGC,
818         int nrectFill,  
819         xRectangle *prectInit
820    );  
821    int PolyFillRectTiledFlags;
822
823    /** FillSpans **/   
824
825    void (*FillSpansSolid)(
826         DrawablePtr     pDraw,
827         GCPtr           pGC,
828         int             nInit,
829         DDXPointPtr     ppt,
830         int             *pwidth,
831         int             fSorted 
832    );
833    int FillSpansSolidFlags;
834
835    void (*FillSpansStippled)(
836         DrawablePtr     pDraw,
837         GCPtr           pGC,
838         int             nInit,
839         DDXPointPtr     ppt,
840         int             *pwidth,
841         int             fSorted 
842    );
843    int FillSpansStippledFlags;
844
845    void (*FillSpansOpaqueStippled)(
846         DrawablePtr     pDraw,
847         GCPtr           pGC,
848         int             nInit,
849         DDXPointPtr     ppt,
850         int             *pwidth,
851         int             fSorted 
852    );
853    int FillSpansOpaqueStippledFlags;
854
855    void (*FillSpansTiled)(
856         DrawablePtr     pDraw,
857         GCPtr           pGC,
858         int             nInit,
859         DDXPointPtr     ppt,
860         int             *pwidth,
861         int             fSorted 
862    );
863    int FillSpansTiledFlags;
864
865    int (*PolyText8TE) (
866         DrawablePtr pDraw,
867         GCPtr pGC,
868         int x, int y,
869         int count,
870         char *chars
871    );
872    int PolyText8TEFlags;
873
874    int (*PolyText16TE) (
875         DrawablePtr pDraw,
876         GCPtr pGC,
877         int x, int y,
878         int count,
879         unsigned short *chars
880    );
881    int PolyText16TEFlags;
882
883    void (*ImageText8TE) (
884         DrawablePtr pDraw,
885         GCPtr pGC,
886         int x, int y,
887         int count,
888         char *chars
889    );
890    int ImageText8TEFlags;
891
892    void (*ImageText16TE) (
893         DrawablePtr pDraw,
894         GCPtr pGC,
895         int x, int y,
896         int count,
897         unsigned short *chars
898    );
899    int ImageText16TEFlags;
900
901    void (*ImageGlyphBltTE) (
902         DrawablePtr pDrawable,
903         GCPtr pGC,
904         int xInit, int yInit,
905         unsigned int nglyph,
906         CharInfoPtr *ppci,
907         pointer pglyphBase 
908    );
909    int ImageGlyphBltTEFlags;
910
911    void (*PolyGlyphBltTE) (
912         DrawablePtr pDrawable,
913         GCPtr pGC,
914         int xInit, int yInit,
915         unsigned int nglyph,
916         CharInfoPtr *ppci,
917         pointer pglyphBase 
918    );
919    int PolyGlyphBltTEFlags;
920
921    int (*PolyText8NonTE) (
922         DrawablePtr pDraw,
923         GCPtr pGC,
924         int x, int y,
925         int count,
926         char *chars
927    );
928    int PolyText8NonTEFlags;
929
930    int (*PolyText16NonTE) (
931         DrawablePtr pDraw,
932         GCPtr pGC,
933         int x, int y,
934         int count,
935         unsigned short *chars
936    );
937    int PolyText16NonTEFlags;
938
939    void (*ImageText8NonTE) (
940         DrawablePtr pDraw,
941         GCPtr pGC,
942         int x, int y,
943         int count,
944         char *chars
945    );
946    int ImageText8NonTEFlags;
947
948    void (*ImageText16NonTE) (
949         DrawablePtr pDraw,
950         GCPtr pGC,
951         int x, int y,
952         int count,
953         unsigned short *chars
954    );
955    int ImageText16NonTEFlags;
956
957    void (*ImageGlyphBltNonTE) (
958         DrawablePtr pDrawable,
959         GCPtr pGC,
960         int xInit, int yInit,
961         unsigned int nglyph,
962         CharInfoPtr *ppci,
963         pointer pglyphBase 
964    );
965    int ImageGlyphBltNonTEFlags;
966
967    void (*PolyGlyphBltNonTE) (
968         DrawablePtr pDrawable,
969         GCPtr pGC,
970         int xInit, int yInit,
971         unsigned int nglyph,
972         CharInfoPtr *ppci,
973         pointer pglyphBase 
974    );
975    int PolyGlyphBltNonTEFlags;
976
977    void (*PolyRectangleThinSolid)(
978         DrawablePtr  pDrawable,
979         GCPtr        pGC,    
980         int          nRectsInit,
981         xRectangle  *pRectsInit 
982    );
983    int PolyRectangleThinSolidFlags;
984
985    void (*PolylinesWideSolid)(
986         DrawablePtr     pDrawable,
987         GCPtr           pGC,
988         int             mode,
989         int             npt,
990         DDXPointPtr pPts
991    );
992    int PolylinesWideSolidFlags;
993
994    void (*PolylinesThinSolid)(
995         DrawablePtr     pDrawable,
996         GCPtr           pGC,
997         int             mode,
998         int             npt,
999         DDXPointPtr pPts
1000    );
1001    int PolylinesThinSolidFlags;
1002
1003    void (*PolySegmentThinSolid)(
1004         DrawablePtr     pDrawable,
1005         GCPtr           pGC,
1006         int             nseg,
1007         xSegment        *pSeg
1008    );
1009    int PolySegmentThinSolidFlags;
1010
1011    void (*PolylinesThinDashed)(
1012         DrawablePtr     pDrawable,
1013         GCPtr           pGC,
1014         int             mode,
1015         int             npt,
1016         DDXPointPtr pPts
1017    );
1018    int PolylinesThinDashedFlags;
1019
1020    void (*PolySegmentThinDashed)(
1021         DrawablePtr     pDrawable,
1022         GCPtr           pGC,
1023         int             nseg,
1024         xSegment        *pSeg
1025    );
1026    int PolySegmentThinDashedFlags;
1027
1028    void (*FillPolygonSolid)(
1029         DrawablePtr     pDrawable,
1030         GCPtr           pGC,
1031         int             shape,
1032         int             mode,
1033         int             count,
1034         DDXPointPtr     ptsIn 
1035    );
1036    int FillPolygonSolidFlags;
1037
1038    void (*FillPolygonStippled)(
1039         DrawablePtr     pDrawable,
1040         GCPtr           pGC,
1041         int             shape,
1042         int             mode,
1043         int             count,
1044         DDXPointPtr     ptsIn 
1045    );
1046    int FillPolygonStippledFlags;
1047
1048    void (*FillPolygonOpaqueStippled)(
1049         DrawablePtr     pDrawable,
1050         GCPtr           pGC,
1051         int             shape,
1052         int             mode,
1053         int             count,
1054         DDXPointPtr     ptsIn 
1055    );
1056    int FillPolygonOpaqueStippledFlags;
1057
1058    void (*FillPolygonTiled)(
1059         DrawablePtr     pDrawable,
1060         GCPtr           pGC,
1061         int             shape,
1062         int             mode,
1063         int             count,
1064         DDXPointPtr     ptsIn 
1065    );
1066    int FillPolygonTiledFlags;
1067
1068    void (*PolyFillArcSolid)(
1069         DrawablePtr     pDraw,
1070         GCPtr           pGC,
1071         int             narcs,
1072         xArc            *parcs
1073    );
1074    int PolyFillArcSolidFlags;
1075
1076    void (*PutImage)(
1077         DrawablePtr pDraw,
1078         GCPtr       pGC,
1079         int         depth, 
1080         int         x, 
1081         int         y, 
1082         int         w, 
1083         int         h,
1084         int         leftPad,
1085         int         format,
1086         char        *pImage
1087    );
1088    int PutImageFlags;
1089    
1090    /* Validation masks */
1091
1092    unsigned long FillSpansMask;
1093    ValidateGCProcPtr ValidateFillSpans;
1094    unsigned long SetSpansMask;
1095    ValidateGCProcPtr ValidateSetSpans;
1096    unsigned long PutImageMask;
1097    ValidateGCProcPtr ValidatePutImage;
1098    unsigned long CopyAreaMask;
1099    ValidateGCProcPtr ValidateCopyArea;
1100    unsigned long CopyPlaneMask;
1101    ValidateGCProcPtr ValidateCopyPlane;
1102    unsigned long PolyPointMask;
1103    ValidateGCProcPtr ValidatePolyPoint;
1104    unsigned long PolylinesMask;
1105    ValidateGCProcPtr ValidatePolylines;
1106    unsigned long PolySegmentMask;
1107    ValidateGCProcPtr ValidatePolySegment;
1108    unsigned long PolyRectangleMask;
1109    ValidateGCProcPtr ValidatePolyRectangle;
1110    unsigned long PolyArcMask;
1111    ValidateGCProcPtr ValidatePolyArc;
1112    unsigned long FillPolygonMask;
1113    ValidateGCProcPtr ValidateFillPolygon;
1114    unsigned long PolyFillRectMask;
1115    ValidateGCProcPtr ValidatePolyFillRect;
1116    unsigned long PolyFillArcMask;
1117    ValidateGCProcPtr ValidatePolyFillArc;
1118    unsigned long PolyText8Mask;
1119    ValidateGCProcPtr ValidatePolyText8;
1120    unsigned long PolyText16Mask;
1121    ValidateGCProcPtr ValidatePolyText16;
1122    unsigned long ImageText8Mask;
1123    ValidateGCProcPtr ValidateImageText8;
1124    unsigned long ImageText16Mask;
1125    ValidateGCProcPtr ValidateImageText16;
1126    unsigned long PolyGlyphBltMask;
1127    ValidateGCProcPtr ValidatePolyGlyphBlt;
1128    unsigned long ImageGlyphBltMask;
1129    ValidateGCProcPtr ValidateImageGlyphBlt;
1130    unsigned long PushPixelsMask;
1131    ValidateGCProcPtr ValidatePushPixels;
1132
1133    void (*ComputeDash)(GCPtr pGC);
1134
1135    /* Pixmap Cache */
1136
1137    int  PixmapCacheFlags;
1138    Bool UsingPixmapCache;
1139    Bool CanDoMono8x8;
1140    Bool CanDoColor8x8;
1141
1142    void (*InitPixmapCache)(
1143         ScreenPtr pScreen, 
1144         RegionPtr areas,
1145         pointer data
1146    );
1147    void (*ClosePixmapCache)(
1148         ScreenPtr pScreen
1149    );
1150
1151    int (*StippledFillChooser)(GCPtr pGC);
1152    int (*OpaqueStippledFillChooser)(GCPtr pGC);
1153    int (*TiledFillChooser)(GCPtr pGC);
1154
1155    int  CachePixelGranularity;
1156    int  MaxCacheableTileWidth;
1157    int  MaxCacheableTileHeight;
1158    int  MaxCacheableStippleWidth;
1159    int  MaxCacheableStippleHeight;
1160
1161    XAACacheInfoPtr (*CacheTile)(
1162         ScrnInfoPtr Scrn, PixmapPtr pPix
1163    );
1164    XAACacheInfoPtr (*CacheStipple)(
1165         ScrnInfoPtr Scrn, PixmapPtr pPix, 
1166         int fg, int bg
1167    );
1168    XAACacheInfoPtr (*CacheMonoStipple)(
1169         ScrnInfoPtr Scrn, PixmapPtr pPix
1170    );
1171    XAACacheInfoPtr (*CacheMono8x8Pattern)(
1172         ScrnInfoPtr Scrn, int pat0, int pat1
1173    );
1174    XAACacheInfoPtr (*CacheColor8x8Pattern)(
1175         ScrnInfoPtr Scrn, PixmapPtr pPix, 
1176         int fg, int bg
1177    );
1178
1179
1180    int MonoPatternPitch;
1181    int CacheWidthMono8x8Pattern;
1182    int CacheHeightMono8x8Pattern;
1183
1184    int ColorPatternPitch;
1185    int CacheWidthColor8x8Pattern;
1186    int CacheHeightColor8x8Pattern;
1187
1188    int CacheColorExpandDensity;
1189
1190    void (*WriteBitmapToCache) (
1191         ScrnInfoPtr pScrn,
1192         int x, int y, int w, int h,
1193         unsigned char *src,
1194         int srcwidth,
1195         int fg, int bg
1196    );
1197    void (*WritePixmapToCache) (
1198         ScrnInfoPtr pScrn,
1199         int x, int y, int w, int h,
1200         unsigned char *src,
1201         int srcwidth,
1202         int bpp, int depth
1203    );
1204    void (*WriteMono8x8PatternToCache)(
1205         ScrnInfoPtr pScrn, 
1206         XAACacheInfoPtr pCache
1207    );
1208    void (*WriteColor8x8PatternToCache)(
1209         ScrnInfoPtr pScrn, 
1210         PixmapPtr pPix, 
1211         XAACacheInfoPtr pCache
1212    );
1213    
1214    char* PixmapCachePrivate;
1215
1216    /* Miscellaneous */
1217
1218    GC ScratchGC;
1219    int PreAllocSize;
1220    unsigned char *PreAllocMem;
1221
1222    CharInfoPtr CharInfo[255];
1223    NonTEGlyphInfo GlyphInfo[255];
1224
1225    unsigned int FullPlanemask; /* deprecated */
1226
1227    PixmapLinkPtr OffscreenPixmaps;
1228    int maxOffPixWidth;
1229    int maxOffPixHeight;   
1230
1231    XAACacheInfoRec ScratchCacheInfoRec;
1232
1233    BoxPtr ClipBox;
1234
1235    Bool NeedToSync;
1236
1237    char *dgaSaves;
1238
1239    /* These can be supplied to override the defaults */
1240
1241    GetImageProcPtr GetImage;
1242    GetSpansProcPtr GetSpans;
1243    CopyWindowProcPtr CopyWindow;
1244    BackingStoreSaveAreasProcPtr SaveAreas;
1245    BackingStoreRestoreAreasProcPtr RestoreAreas;
1246
1247    unsigned int offscreenDepths;
1248    Bool offscreenDepthsInitialized;
1249
1250    CARD32 FullPlanemasks[32];
1251
1252    Bool (*Composite) (
1253         CARD8      op,
1254         PicturePtr pSrc,
1255         PicturePtr pMask,
1256         PicturePtr pDst,
1257         INT16      xSrc,
1258         INT16      ySrc,
1259         INT16      xMask,
1260         INT16      yMask,
1261         INT16      xDst,
1262         INT16      yDst,
1263         CARD16     width,
1264         CARD16     height
1265    );
1266
1267    Bool (*Glyphs) (
1268         CARD8         op,
1269         PicturePtr    pSrc,
1270         PicturePtr    pDst,
1271         PictFormatPtr maskFormat,
1272         INT16         xSrc,
1273         INT16         ySrc,
1274         int           nlist,
1275         GlyphListPtr  list,
1276         GlyphPtr      *glyphs
1277    );
1278
1279    /* The old SetupForCPUToScreenAlphaTexture function is no longer used because
1280     * it doesn't pass in enough information to write a conforming
1281     * implementation.  See SetupForCPUToScreenAlphaTexture2.
1282     */
1283    Bool (*SetupForCPUToScreenAlphaTexture) (
1284         ScrnInfoPtr     pScrn,
1285         int             op,
1286         CARD16          red,
1287         CARD16          green,
1288         CARD16          blue,
1289         CARD16          alpha,
1290         int             alphaType,
1291         CARD8           *alphaPtr,
1292         int             alphaPitch,
1293         int             width,
1294         int             height,
1295         int             flags
1296    );
1297    void (*SubsequentCPUToScreenAlphaTexture) (
1298         ScrnInfoPtr     pScrn,
1299         int             dstx,
1300         int             dsty,
1301         int             srcx,
1302         int             srcy,
1303         int             width,
1304         int             height
1305    );
1306    int CPUToScreenAlphaTextureFlags;
1307    CARD32 * CPUToScreenAlphaTextureFormats;
1308
1309    /* The old SetupForCPUToScreenTexture function is no longer used because
1310     * it doesn't pass in enough information to write a conforming
1311     * implementation.  See SetupForCPUToScreenTexture2.
1312     */
1313    Bool (*SetupForCPUToScreenTexture) (
1314         ScrnInfoPtr     pScrn,
1315         int             op,
1316         int             texType,
1317         CARD8           *texPtr,
1318         int             texPitch,
1319         int             width,
1320         int             height,
1321         int             flags
1322    );
1323    void (*SubsequentCPUToScreenTexture) (
1324         ScrnInfoPtr     pScrn,
1325         int             dstx,
1326         int             dsty,
1327         int             srcx,
1328         int             srcy,
1329         int             width,
1330         int             height
1331    );
1332    int CPUToScreenTextureFlags;
1333    CARD32 * CPUToScreenTextureFormats;
1334
1335
1336    /* these were added for 4.3.0 */
1337    BoxRec SolidLineLimits;
1338    BoxRec DashedLineLimits;
1339
1340    /* These were added for X.Org 6.8.0 */
1341    Bool (*SetupForCPUToScreenAlphaTexture2) (
1342         ScrnInfoPtr     pScrn,
1343         int             op,
1344         CARD16          red,
1345         CARD16          green,
1346         CARD16          blue,
1347         CARD16          alpha,
1348         CARD32          maskFormat,
1349         CARD32          dstFormat,
1350         CARD8           *alphaPtr,
1351         int             alphaPitch,
1352         int             width,
1353         int             height,
1354         int             flags
1355    );
1356    CARD32 *CPUToScreenAlphaTextureDstFormats;
1357
1358    Bool (*SetupForCPUToScreenTexture2) (
1359         ScrnInfoPtr     pScrn,
1360         int             op,
1361         CARD32          srcFormat,
1362         CARD32          dstFormat,
1363         CARD8           *texPtr,
1364         int             texPitch,
1365         int             width,
1366         int             height,
1367         int             flags
1368    );
1369    CARD32 *CPUToScreenTextureDstFormats;
1370 } XAAInfoRec, *XAAInfoRecPtr;
1371
1372 #define SET_SYNC_FLAG(infoRec)  (infoRec)->NeedToSync = TRUE
1373
1374
1375 extern _X_EXPORT Bool
1376 XAAInit(
1377     ScreenPtr pScreen,
1378     XAAInfoRecPtr infoRec
1379 );
1380
1381 extern _X_EXPORT XAAInfoRecPtr XAACreateInfoRec(void);
1382
1383 extern _X_EXPORT void
1384 XAADestroyInfoRec(
1385     XAAInfoRecPtr infoRec
1386 );
1387
1388 typedef void (*DepthChangeFuncPtr) (ScrnInfoPtr pScrn, int depth);
1389
1390 extern _X_EXPORT Bool
1391 XAAInitDualFramebufferOverlay(
1392    ScreenPtr pScreen, 
1393    DepthChangeFuncPtr callback
1394 );
1395
1396 #endif /* _XAA_H */