1
2#ifdef HAVE_XORG_CONFIG_H
3#include <xorg-config.h>
4#endif
5
6#include "misc.h"
7#include "xf86.h"
8#include "xf86_OSproc.h"
9
10#include <X11/X.h>
11#include "scrnintstr.h"
12#include "pixmapstr.h"
13#include "windowstr.h"
14#include "xf86str.h"
15#include "mi.h"
16#include "miline.h"
17#include "xaa.h"
18#include "xaalocal.h"
19#include "xaawrap.h"
20#include "servermd.h"
21
22#define XAA_STATE_WRAP(func) do {\
23if(infoRec->func) { \
24   pStatePriv->func = infoRec->func;\
25   infoRec->func = XAAStateWrap##func;\
26}} while(0)
27
28/* Wrap all XAA functions and allocate our private structure.
29 */
30
31typedef struct _XAAStateWrapRec {
32   ScrnInfoPtr pScrn;
33   void (*RestoreAccelState)(ScrnInfoPtr pScrn);
34   void (*Sync)(ScrnInfoPtr pScrn);
35   void (*SetupForScreenToScreenCopy)(ScrnInfoPtr pScrn, int xdir, int ydir,
36				      int rop, unsigned int planemask,
37				      int trans_color);
38   void (*SetupForSolidFill)(ScrnInfoPtr pScrn, int color, int rop,
39			     unsigned int planemask);
40   void (*SetupForSolidLine)(ScrnInfoPtr pScrn,int color,int rop,
41			     unsigned int planemask);
42   void (*SetupForDashedLine)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
43			      unsigned int planemask, int length,
44			      unsigned char *pattern);
45   void (*SetClippingRectangle) (ScrnInfoPtr pScrn, int left, int top,
46				 int right, int bottom);
47   void (*DisableClipping)(ScrnInfoPtr pScrn);
48   void (*SetupForMono8x8PatternFill)(ScrnInfoPtr pScrn, int patx, int paty,
49				      int fg, int bg, int rop,
50				      unsigned int planemask);
51   void (*SetupForColor8x8PatternFill)(ScrnInfoPtr pScrn, int patx, int paty,
52				       int rop, unsigned int planemask,
53				       int transparency_color);
54   void (*SetupForCPUToScreenColorExpandFill)(ScrnInfoPtr pScrn, int fg,
55					      int bg, int rop,
56					      unsigned int planemask);
57   void (*SetupForScanlineCPUToScreenColorExpandFill)(ScrnInfoPtr pScrn,
58						      int fg, int bg, int rop,
59						      unsigned int planemask);
60   void (*SetupForScreenToScreenColorExpandFill) (ScrnInfoPtr pScrn,
61						  int fg, int bg, int rop,
62						  unsigned int planemask);
63   void (*SetupForImageWrite)(ScrnInfoPtr pScrn, int rop,
64			      unsigned int planemask, int transparency_color,
65			      int bpp, int depth);
66   void (*SetupForScanlineImageWrite)(ScrnInfoPtr pScrn, int rop,
67				      unsigned int planemask,
68				      int transparency_color,
69				      int bpp, int depth);
70   void (*SetupForImageRead) (ScrnInfoPtr pScrn, int bpp, int depth);
71   void (*ScreenToScreenBitBlt)(ScrnInfoPtr pScrn, int nbox,
72				DDXPointPtr pptSrc, BoxPtr pbox, int xdir,
73				int ydir, int alu, unsigned int planmask);
74   void (*WriteBitmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
75			unsigned char *src, int srcwidth, int skipleft,
76			int fg, int bg, int rop, unsigned int planemask);
77   void (*FillSolidRects)(ScrnInfoPtr pScrn, int fg, int rop,
78			  unsigned int planemask, int nBox, BoxPtr pBox);
79   void (*FillMono8x8PatternRects)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
80				   unsigned int planemask, int nBox,
81				   BoxPtr pBox, int pat0, int pat1,
82				   int xorg, int yorg);
83   void (*FillColor8x8PatternRects)(ScrnInfoPtr pScrn, int rop,
84				    unsigned int planemask, int nBox,
85				    BoxPtr pBox, int xorg, int yorg,
86				    XAACacheInfoPtr pCache);
87   void (*FillCacheBltRects)(ScrnInfoPtr pScrn, int rop,
88			     unsigned int planemask, int nBox, BoxPtr pBox,
89			     int xorg, int yorg, XAACacheInfoPtr pCache);
90   void (*FillColorExpandRects)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
91				unsigned int planemask, int nBox,
92				BoxPtr pBox, int xorg, int yorg,
93				PixmapPtr pPix);
94   void (*FillCacheExpandRects)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
95				unsigned int planemask, int nBox, BoxPtr pBox,
96				int xorg, int yorg, PixmapPtr pPix);
97   void (*FillImageWriteRects)(ScrnInfoPtr pScrn, int rop,
98			       unsigned int planemask, int nBox, BoxPtr pBox,
99			       int xorg, int yorg, PixmapPtr pPix);
100   void (*FillSolidSpans)(ScrnInfoPtr pScrn, int fg, int rop,
101			  unsigned int planemask, int n, DDXPointPtr points,
102			  int *widths, int fSorted);
103   void (*FillMono8x8PatternSpans)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
104				   unsigned int planemask, int n,
105				   DDXPointPtr points, int *widths,
106				   int fSorted, int pat0, int pat1,
107				   int xorg, int yorg);
108   void (*FillColor8x8PatternSpans)(ScrnInfoPtr pScrn, int rop,
109				    unsigned int planemask, int n,
110				    DDXPointPtr points, int *widths,
111				    int fSorted, XAACacheInfoPtr pCache,
112				    int xorg, int yorg);
113   void (*FillCacheBltSpans)(ScrnInfoPtr pScrn, int rop,
114			     unsigned int planemask, int n, DDXPointPtr points,
115			     int *widths, int fSorted, XAACacheInfoPtr pCache,
116			     int xorg, int yorg);
117   void (*FillColorExpandSpans)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
118				unsigned int planemask, int n,
119				DDXPointPtr points, int *widths, int fSorted,
120				int xorg, int yorg, PixmapPtr pPix);
121   void (*FillCacheExpandSpans)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
122				unsigned int planemask, int n, DDXPointPtr ppt,
123				int *pwidth, int fSorted, int xorg, int yorg,
124				PixmapPtr pPix);
125   void (*TEGlyphRenderer)(ScrnInfoPtr pScrn, int x, int y, int w, int h,
126			   int skipleft, int startline, unsigned int **glyphs,
127			   int glyphWidth, int fg, int bg, int rop,
128			   unsigned planemask);
129   void (*NonTEGlyphRenderer)(ScrnInfoPtr pScrn, int x, int y, int n,
130			      NonTEGlyphPtr glyphs, BoxPtr pbox,
131			      int fg, int rop, unsigned int planemask);
132   void (*WritePixmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
133			unsigned char *src, int srcwidth, int rop,
134			unsigned int planemask, int transparency_color,
135			int bpp, int depth);
136   void (*ReadPixmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
137		       unsigned char *dst, int dstwidth, int bpp, int depth);
138   RegionPtr (*CopyArea)(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
139			 GC *pGC, int srcx, int srcy, int width, int height,
140			 int dstx, int dsty);
141   RegionPtr (*CopyPlane)(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
142			  int srcx, int srcy, int width, int height, int dstx,
143			  int dsty, unsigned long bitPlane);
144   void (*PushPixelsSolid) (GCPtr pGC, PixmapPtr pBitMap,
145			    DrawablePtr pDrawable, int dx, int dy, int xOrg,
146			    int yOrg);
147   void (*PolyFillRectSolid)(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
148			     xRectangle *prectInit);
149   void (*PolyFillRectStippled)(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
150				xRectangle *prectInit);
151   void (*PolyFillRectOpaqueStippled)(DrawablePtr pDraw, GCPtr pGC,
152				      int nrectFill, xRectangle *prectInit);
153   void (*PolyFillRectTiled)(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
154			     xRectangle *prectInit);
155   void (*FillSpansSolid)(DrawablePtr pDraw, GCPtr pGC, int nInit,
156			  DDXPointPtr ppt, int *pwidth, int fSorted);
157   void (*FillSpansStippled)(DrawablePtr pDraw, GCPtr pGC, int nInit,
158			     DDXPointPtr ppt, int *pwidth, int fSorted);
159   void (*FillSpansOpaqueStippled)(DrawablePtr pDraw, GCPtr pGC, int nInit,
160				   DDXPointPtr ppt, int *pwidth, int fSorted);
161   void (*FillSpansTiled)(DrawablePtr pDraw, GCPtr pGC, int nInit,
162			  DDXPointPtr ppt, int *pwidth, int fSorted);
163   int (*PolyText8TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
164		       char *chars);
165   int (*PolyText16TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
166			unsigned short *chars);
167   void (*ImageText8TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
168			 char *chars);
169   void (*ImageText16TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
170			  int count, unsigned short *chars);
171   void (*ImageGlyphBltTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
172			    int yInit, unsigned int nglyph, CharInfoPtr *ppci,
173			    pointer pglyphBase);
174   void (*PolyGlyphBltTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
175			   int yInit, unsigned int nglyph, CharInfoPtr *ppci,
176			   pointer pglyphBase);
177   int (*PolyText8NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
178			  int count, char *chars);
179   int (*PolyText16NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
180			   int count, unsigned short *chars);
181   void (*ImageText8NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
182			    int count, char *chars);
183   void (*ImageText16NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
184			     int count, unsigned short *chars);
185   void (*ImageGlyphBltNonTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
186			       int yInit, unsigned int nglyph,
187			       CharInfoPtr *ppci, pointer pglyphBase);
188   void (*PolyGlyphBltNonTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
189			      int yInit, unsigned int nglyph,
190			      CharInfoPtr *ppci, pointer pglyphBase);
191   void (*PolyRectangleThinSolid)(DrawablePtr pDrawable,GCPtr pGC,
192				  int nRectsInit, xRectangle *pRectsInit);
193   void (*PolylinesWideSolid)(DrawablePtr pDrawable, GCPtr pGC, int mode,
194			      int npt, DDXPointPtr pPts);
195   void (*PolylinesThinSolid)(DrawablePtr pDrawable, GCPtr pGC, int mode,
196			      int npt, DDXPointPtr pPts);
197   void (*PolySegmentThinSolid)(DrawablePtr pDrawable, GCPtr pGC, int nseg,
198				xSegment *pSeg);
199   void (*PolylinesThinDashed)(DrawablePtr pDrawable, GCPtr pGC, int mode,
200			       int npt, DDXPointPtr pPts);
201   void (*PolySegmentThinDashed)(DrawablePtr pDrawable, GCPtr pGC, int nseg,
202				 xSegment *pSeg);
203   void (*FillPolygonSolid)(DrawablePtr pDrawable, GCPtr pGC, int shape,
204			    int mode, int count, DDXPointPtr ptsIn);
205   void (*FillPolygonStippled)(DrawablePtr pDrawable, GCPtr pGC, int shape,
206			       int mode, int count, DDXPointPtr ptsIn);
207   void (*FillPolygonOpaqueStippled)(DrawablePtr pDrawable, GCPtr pGC,
208				     int shape, int mode, int count,
209				     DDXPointPtr ptsIn);
210   void (*FillPolygonTiled)(DrawablePtr pDrawable, GCPtr pGC, int shape,
211			    int mode, int count, DDXPointPtr ptsIn);
212   void (*PolyFillArcSolid)(DrawablePtr pDraw, GCPtr pGC, int narcs,
213			    xArc *parcs);
214   void (*PutImage)(DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y,
215		    int w, int h, int leftPad, int format, char *pImage);
216   ValidateGCProcPtr ValidateFillSpans;
217   ValidateGCProcPtr ValidateSetSpans;
218   ValidateGCProcPtr ValidatePutImage;
219   ValidateGCProcPtr ValidateCopyArea;
220   ValidateGCProcPtr ValidateCopyPlane;
221   ValidateGCProcPtr ValidatePolyPoint;
222   ValidateGCProcPtr ValidatePolylines;
223   ValidateGCProcPtr ValidatePolySegment;
224   ValidateGCProcPtr ValidatePolyRectangle;
225   ValidateGCProcPtr ValidatePolyArc;
226   ValidateGCProcPtr ValidateFillPolygon;
227   ValidateGCProcPtr ValidatePolyFillRect;
228   ValidateGCProcPtr ValidatePolyFillArc;
229   ValidateGCProcPtr ValidatePolyText8;
230   ValidateGCProcPtr ValidatePolyText16;
231   ValidateGCProcPtr ValidateImageText8;
232   ValidateGCProcPtr ValidateImageText16;
233   ValidateGCProcPtr ValidatePolyGlyphBlt;
234   ValidateGCProcPtr ValidateImageGlyphBlt;
235   ValidateGCProcPtr ValidatePushPixels;
236   void (*ComputeDash)(GCPtr pGC);
237   void (*InitPixmapCache)(ScreenPtr pScreen, RegionPtr areas, pointer data);
238   void (*ClosePixmapCache)(ScreenPtr pScreen);
239   int (*StippledFillChooser)(GCPtr pGC);
240   int (*OpaqueStippledFillChooser)(GCPtr pGC);
241   int (*TiledFillChooser)(GCPtr pGC);
242   XAACacheInfoPtr (*CacheTile)(ScrnInfoPtr Scrn, PixmapPtr pPix);
243   XAACacheInfoPtr (*CacheStipple)(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg,
244				   int bg);
245   XAACacheInfoPtr (*CacheMonoStipple)(ScrnInfoPtr Scrn, PixmapPtr pPix);
246   XAACacheInfoPtr (*CacheMono8x8Pattern)(ScrnInfoPtr Scrn, int pat0,
247					  int pat1);
248   XAACacheInfoPtr (*CacheColor8x8Pattern)(ScrnInfoPtr Scrn, PixmapPtr pPix,
249					   int fg, int bg);
250   void (*WriteBitmapToCache) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
251			       unsigned char *src, int srcwidth, int fg,
252			       int bg);
253   void (*WritePixmapToCache) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
254			       unsigned char *src, int srcwidth, int bpp,
255			       int depth);
256   void (*WriteMono8x8PatternToCache)(ScrnInfoPtr pScrn,
257				      XAACacheInfoPtr pCache);
258   void (*WriteColor8x8PatternToCache)(ScrnInfoPtr pScrn, PixmapPtr pPix,
259				       XAACacheInfoPtr pCache);
260   GetImageProcPtr GetImage;
261   GetSpansProcPtr GetSpans;
262   CopyWindowProcPtr CopyWindow;
263   Bool (*SetupForCPUToScreenAlphaTexture2)(ScrnInfoPtr pScrn, int op,
264                                           CARD16 red, CARD16 green,
265                                           CARD16 blue, CARD16 alpha,
266					   CARD32 maskFormat, CARD32 dstFormat,
267                                           CARD8 *alphaPtr, int alphaPitch,
268					   int width, int height, int flags);
269   Bool (*SetupForCPUToScreenTexture2)(ScrnInfoPtr pScrn, int op,
270                                      CARD32 srcFormat, CARD32 dstFormat,
271                                      CARD8 *texPtr, int texPitch,
272                                      int width, int height, int flags);
273} XAAStateWrapRec, *XAAStateWrapPtr;
274
275static DevPrivateKeyRec XAAStateKeyRec;
276#define XAAStateKey (&XAAStateKeyRec)
277
278/* Wrap functions start here */
279#define GET_STATEPRIV_GC(pGC)   XAAStateWrapPtr pStatePriv =\
280(XAAStateWrapPtr)dixLookupPrivate(&(pGC)->pScreen->devPrivates, XAAStateKey)
281
282#define GET_STATEPRIV_SCREEN(pScreen)   XAAStateWrapPtr pStatePriv =\
283(XAAStateWrapPtr)dixLookupPrivate(&(pScreen)->devPrivates, XAAStateKey)
284
285#define GET_STATEPRIV_PSCRN(pScrn)   XAAStateWrapPtr pStatePriv =\
286(XAAStateWrapPtr)dixLookupPrivate(&(pScrn)->pScreen->devPrivates, XAAStateKey)
287
288#define STATE_CHECK_SP(pStatePriv) {\
289	ScrnInfoPtr pScrn = pStatePriv->pScrn;\
290	int i = 0;\
291	int need_change = 0;\
292	while(i < pScrn->numEntities) {\
293		if(xf86IsEntityShared(pScrn->entityList[i]) &&\
294		   xf86GetLastScrnFlag(pScrn->entityList[i]) != pScrn->scrnIndex) {\
295			need_change = 1;\
296			xf86SetLastScrnFlag(pScrn->entityList[i],\
297					    pScrn->scrnIndex);\
298		}\
299		i++;\
300	}\
301	if(need_change == 1) (*pStatePriv->RestoreAccelState)(pScrn);\
302}
303
304#define STATE_CHECK_PSCRN(pScrn) {\
305	int i = 0;\
306	int need_change = 0;\
307	while(i < pScrn->numEntities) {\
308		if(xf86IsEntityShared(pScrn->entityList[i]) &&\
309		   xf86GetLastScrnFlag(pScrn->entityList[i]) != pScrn->scrnIndex) {\
310			need_change = 1;\
311			xf86SetLastScrnFlag(pScrn->entityList[i],\
312					    pScrn->scrnIndex);\
313		}\
314		i++;\
315	}\
316	if(need_change == 1) (*pStatePriv->RestoreAccelState)(pScrn);\
317}
318
319static void XAAStateWrapSync(ScrnInfoPtr pScrn)
320{
321   GET_STATEPRIV_PSCRN(pScrn);
322   STATE_CHECK_PSCRN(pScrn);
323
324   (*pStatePriv->Sync)(pScrn);
325}
326
327static void XAAStateWrapSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir,
328						   int rop, unsigned int planemask,
329						   int trans_color)
330{
331   GET_STATEPRIV_PSCRN(pScrn);
332   STATE_CHECK_PSCRN(pScrn);
333
334   (*pStatePriv->SetupForScreenToScreenCopy)(pScrn, xdir, ydir, rop, planemask,
335					     trans_color);
336}
337
338static void XAAStateWrapSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
339					  unsigned int planemask)
340{
341   GET_STATEPRIV_PSCRN(pScrn);
342   STATE_CHECK_PSCRN(pScrn);
343
344   (*pStatePriv->SetupForSolidFill)(pScrn, color, rop, planemask);
345}
346
347static void XAAStateWrapSetupForSolidLine(ScrnInfoPtr pScrn,int color,int rop,
348					  unsigned int planemask)
349{
350   GET_STATEPRIV_PSCRN(pScrn);
351   STATE_CHECK_PSCRN(pScrn);
352
353   (*pStatePriv->SetupForSolidLine)(pScrn, color, rop, planemask);
354}
355
356static void XAAStateWrapSetupForDashedLine(ScrnInfoPtr pScrn, int fg, int bg, int rop,
357					   unsigned int planemask, int length,
358					   unsigned char *pattern)
359{
360   GET_STATEPRIV_PSCRN(pScrn);
361   STATE_CHECK_PSCRN(pScrn);
362
363   (*pStatePriv->SetupForDashedLine)(pScrn, fg, bg, rop, planemask, length, pattern);
364}
365
366static void XAAStateWrapSetClippingRectangle(ScrnInfoPtr pScrn, int left, int top,
367					     int right, int bottom)
368{
369   GET_STATEPRIV_PSCRN(pScrn);
370   STATE_CHECK_PSCRN(pScrn);
371
372   (*pStatePriv->SetClippingRectangle)(pScrn, left, top, right, bottom);
373}
374
375static void XAAStateWrapDisableClipping(ScrnInfoPtr pScrn)
376{
377   GET_STATEPRIV_PSCRN(pScrn);
378   STATE_CHECK_PSCRN(pScrn);
379
380   (*pStatePriv->DisableClipping)(pScrn);
381}
382
383static void XAAStateWrapSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
384						   int fg, int bg, int rop,
385						   unsigned int planemask)
386{
387   GET_STATEPRIV_PSCRN(pScrn);
388   STATE_CHECK_PSCRN(pScrn);
389
390   (*pStatePriv->SetupForMono8x8PatternFill)(pScrn, patx, paty, fg, bg, rop, planemask);
391}
392
393static void XAAStateWrapSetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
394						    int rop, unsigned int planemask,
395						    int transparency_color)
396{
397   GET_STATEPRIV_PSCRN(pScrn);
398   STATE_CHECK_PSCRN(pScrn);
399
400   (*pStatePriv->SetupForColor8x8PatternFill)(pScrn, patx, paty, rop, planemask,
401					      transparency_color);
402}
403
404static void XAAStateWrapSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg,
405							   int bg, int rop,
406							   unsigned int planemask)
407{
408   GET_STATEPRIV_PSCRN(pScrn);
409   STATE_CHECK_PSCRN(pScrn);
410
411   (*pStatePriv->SetupForCPUToScreenColorExpandFill)(pScrn, fg, bg, rop, planemask);
412}
413
414static void XAAStateWrapSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
415								   int fg, int bg,
416								   int rop,
417								   unsigned int planemask)
418{
419   GET_STATEPRIV_PSCRN(pScrn);
420   STATE_CHECK_PSCRN(pScrn);
421
422   (*pStatePriv->SetupForScanlineCPUToScreenColorExpandFill)(pScrn, fg, bg, rop,
423							     planemask);
424}
425
426static void XAAStateWrapSetupForScreenToScreenColorExpandFill(ScrnInfoPtr pScrn,
427							      int fg, int bg, int rop,
428							      unsigned int planemask)
429{
430   GET_STATEPRIV_PSCRN(pScrn);
431   STATE_CHECK_PSCRN(pScrn);
432
433   (*pStatePriv->SetupForScreenToScreenColorExpandFill)(pScrn, fg, bg, rop, planemask);
434}
435
436static void XAAStateWrapSetupForImageWrite(ScrnInfoPtr pScrn, int rop,
437					   unsigned int planemask, int transparency_color,
438					   int bpp, int depth)
439{
440   GET_STATEPRIV_PSCRN(pScrn);
441   STATE_CHECK_PSCRN(pScrn);
442
443   (*pStatePriv->SetupForImageWrite)(pScrn, rop, planemask, transparency_color, bpp,
444				     depth);
445}
446
447static void XAAStateWrapSetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop,
448						   unsigned int planemask,
449						   int transparency_color,
450						   int bpp, int depth)
451{
452   GET_STATEPRIV_PSCRN(pScrn);
453   STATE_CHECK_PSCRN(pScrn);
454
455   (*pStatePriv->SetupForScanlineImageWrite)(pScrn, rop, planemask, transparency_color,
456					     bpp, depth);
457}
458
459static void XAAStateWrapSetupForImageRead(ScrnInfoPtr pScrn, int bpp, int depth)
460{
461   GET_STATEPRIV_PSCRN(pScrn);
462   STATE_CHECK_PSCRN(pScrn);
463
464   (*pStatePriv->SetupForImageRead)(pScrn, bpp, depth);
465}
466
467static void XAAStateWrapScreenToScreenBitBlt(ScrnInfoPtr pScrn, int nbox,
468					     DDXPointPtr pptSrc, BoxPtr pbox, int xdir,
469					     int ydir, int alu, unsigned int planmask)
470{
471   GET_STATEPRIV_PSCRN(pScrn);
472   STATE_CHECK_PSCRN(pScrn);
473
474   (*pStatePriv->ScreenToScreenBitBlt)(pScrn, nbox,
475				       pptSrc, pbox, xdir,
476				       ydir, alu, planmask);
477}
478
479static void XAAStateWrapWriteBitmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
480				    unsigned char *src, int srcwidth, int skipleft,
481				    int fg, int bg, int rop, unsigned int planemask)
482{
483   GET_STATEPRIV_PSCRN(pScrn);
484   STATE_CHECK_PSCRN(pScrn);
485
486   (*pStatePriv->WriteBitmap)(pScrn, x, y, w, h,
487			      src, srcwidth, skipleft,
488			      fg, bg, rop, planemask);
489}
490
491static void XAAStateWrapFillSolidRects(ScrnInfoPtr pScrn, int fg, int rop,
492				       unsigned int planemask, int nBox, BoxPtr pBox)
493{
494   GET_STATEPRIV_PSCRN(pScrn);
495   STATE_CHECK_PSCRN(pScrn);
496
497   (*pStatePriv->FillSolidRects)(pScrn, fg, rop,
498				 planemask, nBox, pBox);
499}
500
501static void XAAStateWrapFillMono8x8PatternRects(ScrnInfoPtr pScrn, int fg, int bg,
502						int rop, unsigned int planemask, int nBox,
503						BoxPtr pBox, int pat0, int pat1,
504						int xorg, int yorg)
505{
506   GET_STATEPRIV_PSCRN(pScrn);
507   STATE_CHECK_PSCRN(pScrn);
508
509   (*pStatePriv->FillMono8x8PatternRects)(pScrn, fg, bg,
510					  rop, planemask, nBox,
511					  pBox, pat0, pat1,
512					  xorg, yorg);
513}
514
515static void XAAStateWrapFillColor8x8PatternRects(ScrnInfoPtr pScrn, int rop,
516						 unsigned int planemask, int nBox,
517						 BoxPtr pBox, int xorg, int yorg,
518						 XAACacheInfoPtr pCache)
519{
520   GET_STATEPRIV_PSCRN(pScrn);
521   STATE_CHECK_PSCRN(pScrn);
522
523   (*pStatePriv->FillColor8x8PatternRects)(pScrn, rop,
524					   planemask, nBox,
525					   pBox, xorg, yorg,
526					   pCache);
527}
528
529static void XAAStateWrapFillCacheBltRects(ScrnInfoPtr pScrn, int rop,
530					  unsigned int planemask, int nBox, BoxPtr pBox,
531					  int xorg, int yorg, XAACacheInfoPtr pCache)
532{
533   GET_STATEPRIV_PSCRN(pScrn);
534   STATE_CHECK_PSCRN(pScrn);
535
536   (*pStatePriv->FillCacheBltRects)(pScrn, rop,
537				    planemask, nBox, pBox,
538				    xorg, yorg, pCache);
539}
540
541static void XAAStateWrapFillColorExpandRects(ScrnInfoPtr pScrn, int fg, int bg, int rop,
542					     unsigned int planemask, int nBox,
543					     BoxPtr pBox, int xorg, int yorg,
544					     PixmapPtr pPix)
545{
546   GET_STATEPRIV_PSCRN(pScrn);
547   STATE_CHECK_PSCRN(pScrn);
548
549   (*pStatePriv->FillColorExpandRects)(pScrn, fg, bg, rop,
550				       planemask, nBox,
551				       pBox, xorg, yorg,
552				       pPix);
553}
554
555static void XAAStateWrapFillCacheExpandRects(ScrnInfoPtr pScrn, int fg, int bg, int rop,
556					     unsigned int planemask, int nBox,
557					     BoxPtr pBox, int xorg, int yorg,
558					     PixmapPtr pPix)
559{
560   GET_STATEPRIV_PSCRN(pScrn);
561   STATE_CHECK_PSCRN(pScrn);
562
563   (*pStatePriv->FillCacheExpandRects)(pScrn, fg, bg, rop,
564				       planemask, nBox,
565				       pBox, xorg, yorg,
566				       pPix);
567}
568
569static void XAAStateWrapFillImageWriteRects(ScrnInfoPtr pScrn, int rop,
570					    unsigned int planemask, int nBox, BoxPtr pBox,
571					    int xorg, int yorg, PixmapPtr pPix)
572{
573   GET_STATEPRIV_PSCRN(pScrn);
574   STATE_CHECK_PSCRN(pScrn);
575
576   (*pStatePriv->FillImageWriteRects)(pScrn, rop,
577				      planemask, nBox, pBox,
578				      xorg, yorg, pPix);
579}
580
581static void XAAStateWrapFillSolidSpans(ScrnInfoPtr pScrn, int fg, int rop,
582				       unsigned int planemask, int n, DDXPointPtr points,
583				       int *widths, int fSorted)
584{
585   GET_STATEPRIV_PSCRN(pScrn);
586   STATE_CHECK_PSCRN(pScrn);
587
588   (*pStatePriv->FillSolidSpans)(pScrn, fg, rop,
589				 planemask, n, points,
590				 widths, fSorted);
591}
592
593static void XAAStateWrapFillMono8x8PatternSpans(ScrnInfoPtr pScrn, int fg, int bg,
594						int rop, unsigned int planemask, int n,
595						DDXPointPtr points, int *widths,
596						int fSorted, int pat0, int pat1,
597						int xorg, int yorg)
598{
599   GET_STATEPRIV_PSCRN(pScrn);
600   STATE_CHECK_PSCRN(pScrn);
601
602   (*pStatePriv->FillMono8x8PatternSpans)(pScrn, fg, bg,
603					  rop, planemask, n,
604					  points, widths,
605					  fSorted, pat0, pat1,
606					  xorg, yorg);
607}
608
609static void XAAStateWrapFillColor8x8PatternSpans(ScrnInfoPtr pScrn, int rop,
610						 unsigned int planemask, int n,
611						 DDXPointPtr points, int *widths,
612						 int fSorted, XAACacheInfoPtr pCache,
613						 int xorg, int yorg)
614{
615   GET_STATEPRIV_PSCRN(pScrn);
616   STATE_CHECK_PSCRN(pScrn);
617
618   (*pStatePriv->FillColor8x8PatternSpans)(pScrn, rop,
619					   planemask, n,
620					   points, widths,
621					   fSorted, pCache,
622					   xorg, yorg);
623}
624
625static void XAAStateWrapFillCacheBltSpans(ScrnInfoPtr pScrn, int rop,
626					  unsigned int planemask, int n,
627					  DDXPointPtr points, int *widths,
628					  int fSorted, XAACacheInfoPtr pCache,
629					  int xorg, int yorg)
630{
631   GET_STATEPRIV_PSCRN(pScrn);
632   STATE_CHECK_PSCRN(pScrn);
633
634   (*pStatePriv->FillCacheBltSpans)(pScrn, rop,
635				    planemask, n,
636				    points, widths,
637				    fSorted, pCache,
638				    xorg, yorg);
639}
640
641static void XAAStateWrapFillColorExpandSpans(ScrnInfoPtr pScrn, int fg, int bg, int rop,
642					     unsigned int planemask, int n,
643					     DDXPointPtr points, int *widths, int fSorted,
644					     int xorg, int yorg, PixmapPtr pPix)
645{
646   GET_STATEPRIV_PSCRN(pScrn);
647   STATE_CHECK_PSCRN(pScrn);
648
649   (*pStatePriv->FillColorExpandSpans)(pScrn, fg, bg, rop,
650				       planemask, n,
651				       points, widths, fSorted,
652				       xorg, yorg, pPix);
653}
654
655static void XAAStateWrapFillCacheExpandSpans(ScrnInfoPtr pScrn, int fg, int bg, int rop,
656					     unsigned int planemask, int n,
657					     DDXPointPtr ppt, int *pwidth, int fSorted,
658					     int xorg, int yorg, PixmapPtr pPix)
659{
660   GET_STATEPRIV_PSCRN(pScrn);
661   STATE_CHECK_PSCRN(pScrn);
662
663   (*pStatePriv->FillCacheExpandSpans)(pScrn, fg, bg, rop,
664				       planemask, n,
665				       ppt, pwidth, fSorted,
666				       xorg, yorg, pPix);
667}
668
669static void XAAStateWrapTEGlyphRenderer(ScrnInfoPtr pScrn, int x, int y, int w, int h,
670					int skipleft, int startline,
671					unsigned int **glyphs,
672					int glyphWidth, int fg, int bg, int rop,
673					unsigned planemask)
674{
675   GET_STATEPRIV_PSCRN(pScrn);
676   STATE_CHECK_PSCRN(pScrn);
677
678   (*pStatePriv->TEGlyphRenderer)(pScrn, x, y, w, h,
679				  skipleft, startline,
680				  glyphs,
681				  glyphWidth, fg, bg, rop,
682				  planemask);
683}
684
685static void XAAStateWrapNonTEGlyphRenderer(ScrnInfoPtr pScrn, int x, int y, int n,
686					   NonTEGlyphPtr glyphs, BoxPtr pbox,
687					   int fg, int rop, unsigned int planemask)
688{
689   GET_STATEPRIV_PSCRN(pScrn);
690   STATE_CHECK_PSCRN(pScrn);
691
692   (*pStatePriv->NonTEGlyphRenderer)(pScrn, x, y, n,
693				     glyphs, pbox,
694				     fg, rop, planemask);
695}
696
697static void XAAStateWrapWritePixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
698				    unsigned char *src, int srcwidth, int rop,
699				    unsigned int planemask, int transparency_color,
700				    int bpp, int depth)
701{
702   GET_STATEPRIV_PSCRN(pScrn);
703   STATE_CHECK_PSCRN(pScrn);
704
705   (*pStatePriv->WritePixmap)(pScrn, x, y, w, h,
706			      src, srcwidth, rop,
707			      planemask, transparency_color,
708			      bpp, depth);
709}
710
711static void XAAStateWrapReadPixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
712				   unsigned char *dst, int dstwidth, int bpp, int depth)
713{
714   GET_STATEPRIV_PSCRN(pScrn);
715   STATE_CHECK_PSCRN(pScrn);
716
717   (*pStatePriv->ReadPixmap)(pScrn, x, y, w, h,
718			     dst, dstwidth, bpp, depth);
719}
720
721static RegionPtr XAAStateWrapCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
722				      GC *pGC, int srcx, int srcy, int width, int height,
723				      int dstx, int dsty)
724{
725   GET_STATEPRIV_GC(pGC);
726   STATE_CHECK_SP(pStatePriv);
727
728   return (*pStatePriv->CopyArea)(pSrcDrawable, pDstDrawable,
729				  pGC, srcx, srcy, width, height,
730				  dstx, dsty);
731}
732
733static RegionPtr XAAStateWrapCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
734				       int srcx, int srcy, int width, int height,
735				       int dstx, int dsty, unsigned long bitPlane)
736{
737   GET_STATEPRIV_GC(pGC);
738   STATE_CHECK_SP(pStatePriv);
739
740   return (*pStatePriv->CopyPlane)(pSrc, pDst, pGC,
741				   srcx, srcy, width, height,
742				   dstx, dsty, bitPlane);
743}
744
745static void XAAStateWrapPushPixelsSolid(GCPtr pGC, PixmapPtr pBitMap,
746					DrawablePtr pDrawable, int dx, int dy, int xOrg,
747					int yOrg)
748{
749   GET_STATEPRIV_GC(pGC);
750   STATE_CHECK_SP(pStatePriv);
751
752   (*pStatePriv->PushPixelsSolid)(pGC, pBitMap,
753				  pDrawable, dx, dy, xOrg,
754				  yOrg);
755}
756
757static void XAAStateWrapPolyFillRectSolid(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
758					  xRectangle *prectInit)
759{
760   GET_STATEPRIV_GC(pGC);
761   STATE_CHECK_SP(pStatePriv);
762
763   (*pStatePriv->PolyFillRectSolid)(pDraw, pGC, nrectFill,
764				    prectInit);
765}
766
767static void XAAStateWrapPolyFillRectStippled(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
768					     xRectangle *prectInit)
769{
770   GET_STATEPRIV_GC(pGC);
771   STATE_CHECK_SP(pStatePriv);
772
773   (*pStatePriv->PolyFillRectStippled)(pDraw, pGC, nrectFill,
774				       prectInit);
775}
776
777static void XAAStateWrapPolyFillRectOpaqueStippled(DrawablePtr pDraw, GCPtr pGC,
778						   int nrectFill, xRectangle *prectInit)
779{
780   GET_STATEPRIV_GC(pGC);
781   STATE_CHECK_SP(pStatePriv);
782
783   (*pStatePriv->PolyFillRectOpaqueStippled)(pDraw, pGC,
784					     nrectFill, prectInit);
785}
786
787static void XAAStateWrapPolyFillRectTiled(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
788					  xRectangle *prectInit)
789{
790   GET_STATEPRIV_GC(pGC);
791   STATE_CHECK_SP(pStatePriv);
792
793   (*pStatePriv->PolyFillRectTiled)(pDraw, pGC, nrectFill,
794				    prectInit);
795}
796
797static void XAAStateWrapFillSpansSolid(DrawablePtr pDraw, GCPtr pGC, int nInit,
798				       DDXPointPtr ppt, int *pwidth, int fSorted)
799{
800   GET_STATEPRIV_GC(pGC);
801   STATE_CHECK_SP(pStatePriv);
802
803   (*pStatePriv->FillSpansSolid)(pDraw, pGC, nInit,
804				 ppt, pwidth, fSorted);
805}
806
807static void XAAStateWrapFillSpansStippled(DrawablePtr pDraw, GCPtr pGC, int nInit,
808					  DDXPointPtr ppt, int *pwidth, int fSorted)
809{
810   GET_STATEPRIV_GC(pGC);
811   STATE_CHECK_SP(pStatePriv);
812
813   (*pStatePriv->FillSpansStippled)(pDraw, pGC, nInit,
814				    ppt, pwidth, fSorted);
815}
816
817static void XAAStateWrapFillSpansOpaqueStippled(DrawablePtr pDraw, GCPtr pGC, int nInit,
818						DDXPointPtr ppt, int *pwidth, int fSorted)
819{
820   GET_STATEPRIV_GC(pGC);
821   STATE_CHECK_SP(pStatePriv);
822
823   (*pStatePriv->FillSpansOpaqueStippled)(pDraw, pGC, nInit,
824					  ppt, pwidth, fSorted);
825}
826
827static void XAAStateWrapFillSpansTiled(DrawablePtr pDraw, GCPtr pGC, int nInit,
828				       DDXPointPtr ppt, int *pwidth, int fSorted)
829{
830   GET_STATEPRIV_GC(pGC);
831   STATE_CHECK_SP(pStatePriv);
832
833   (*pStatePriv->FillSpansTiled)(pDraw, pGC, nInit,
834				 ppt, pwidth, fSorted);
835}
836
837static int XAAStateWrapPolyText8TE(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
838				   char *chars)
839{
840   GET_STATEPRIV_GC(pGC);
841   STATE_CHECK_SP(pStatePriv);
842
843   return (*pStatePriv->PolyText8TE)(pDraw, pGC, x, y, count,
844				     chars);
845}
846
847static int XAAStateWrapPolyText16TE(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
848				    unsigned short *chars)
849{
850   GET_STATEPRIV_GC(pGC);
851   STATE_CHECK_SP(pStatePriv);
852
853   return (*pStatePriv->PolyText16TE)(pDraw, pGC, x, y, count,
854				      chars);
855}
856
857static void XAAStateWrapImageText8TE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
858				     int count, char *chars)
859{
860   GET_STATEPRIV_GC(pGC);
861   STATE_CHECK_SP(pStatePriv);
862
863   (*pStatePriv->ImageText8TE)(pDraw, pGC, x, y,
864			       count, chars);
865}
866
867static void XAAStateWrapImageText16TE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
868				      int count, unsigned short *chars)
869{
870   GET_STATEPRIV_GC(pGC);
871   STATE_CHECK_SP(pStatePriv);
872
873   (*pStatePriv->ImageText16TE)(pDraw, pGC, x, y,
874				count, chars);
875}
876
877static void XAAStateWrapImageGlyphBltTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
878					int yInit, unsigned int nglyph, CharInfoPtr *ppci,
879					pointer pglyphBase)
880{
881   GET_STATEPRIV_GC(pGC);
882   STATE_CHECK_SP(pStatePriv);
883
884   (*pStatePriv->ImageGlyphBltTE)(pDrawable, pGC, xInit,
885				  yInit, nglyph, ppci,
886				  pglyphBase);
887}
888
889static void XAAStateWrapPolyGlyphBltTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
890				       int yInit, unsigned int nglyph, CharInfoPtr *ppci,
891				       pointer pglyphBase)
892{
893   GET_STATEPRIV_GC(pGC);
894   STATE_CHECK_SP(pStatePriv);
895
896   (*pStatePriv->PolyGlyphBltTE)(pDrawable, pGC, xInit,
897				 yInit, nglyph, ppci,
898				 pglyphBase);
899}
900
901static int XAAStateWrapPolyText8NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
902				      int count, char *chars)
903{
904   GET_STATEPRIV_GC(pGC);
905   STATE_CHECK_SP(pStatePriv);
906
907   return (*pStatePriv->PolyText8NonTE)(pDraw, pGC, x, y,
908					count, chars);
909}
910
911static int XAAStateWrapPolyText16NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
912				       int count, unsigned short *chars)
913{
914   GET_STATEPRIV_GC(pGC);
915   STATE_CHECK_SP(pStatePriv);
916
917   return (*pStatePriv->PolyText16NonTE)(pDraw, pGC, x, y,
918					 count, chars);
919}
920
921static void XAAStateWrapImageText8NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
922					int count, char *chars)
923{
924   GET_STATEPRIV_GC(pGC);
925   STATE_CHECK_SP(pStatePriv);
926
927   (*pStatePriv->ImageText8NonTE)(pDraw, pGC, x, y,
928				  count, chars);
929}
930
931static void XAAStateWrapImageText16NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
932					 int count, unsigned short *chars)
933{
934   GET_STATEPRIV_GC(pGC);
935   STATE_CHECK_SP(pStatePriv);
936
937   (*pStatePriv->ImageText16NonTE)(pDraw, pGC, x, y,
938				   count, chars);
939}
940
941static void XAAStateWrapImageGlyphBltNonTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
942					   int yInit, unsigned int nglyph,
943					   CharInfoPtr *ppci, pointer pglyphBase)
944{
945   GET_STATEPRIV_GC(pGC);
946   STATE_CHECK_SP(pStatePriv);
947
948   (*pStatePriv->ImageGlyphBltNonTE)(pDrawable, pGC, xInit,
949				     yInit, nglyph,
950				     ppci, pglyphBase);
951}
952
953static void XAAStateWrapPolyGlyphBltNonTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
954					  int yInit, unsigned int nglyph,
955					  CharInfoPtr *ppci, pointer pglyphBase)
956{
957   GET_STATEPRIV_GC(pGC);
958   STATE_CHECK_SP(pStatePriv);
959
960   (*pStatePriv->PolyGlyphBltNonTE)(pDrawable, pGC, xInit,
961				    yInit, nglyph,
962				    ppci, pglyphBase);
963}
964
965static void XAAStateWrapPolyRectangleThinSolid(DrawablePtr pDrawable,GCPtr pGC,
966					       int nRectsInit, xRectangle *pRectsInit)
967{
968   GET_STATEPRIV_GC(pGC);
969   STATE_CHECK_SP(pStatePriv);
970
971   (*pStatePriv->PolyRectangleThinSolid)(pDrawable, pGC,
972					 nRectsInit, pRectsInit);
973}
974
975static void XAAStateWrapPolylinesWideSolid(DrawablePtr pDrawable, GCPtr pGC, int mode,
976					   int npt, DDXPointPtr pPts)
977{
978   GET_STATEPRIV_GC(pGC);
979   STATE_CHECK_SP(pStatePriv);
980
981   (*pStatePriv->PolylinesWideSolid)(pDrawable, pGC, mode,
982				     npt, pPts);
983}
984
985static void XAAStateWrapPolylinesThinSolid(DrawablePtr pDrawable, GCPtr pGC, int mode,
986					   int npt, DDXPointPtr pPts)
987{
988   GET_STATEPRIV_GC(pGC);
989   STATE_CHECK_SP(pStatePriv);
990
991   (*pStatePriv->PolylinesThinSolid)(pDrawable, pGC, mode,
992				     npt, pPts);
993}
994
995static void XAAStateWrapPolySegmentThinSolid(DrawablePtr pDrawable, GCPtr pGC, int nseg,
996					     xSegment *pSeg)
997{
998   GET_STATEPRIV_GC(pGC);
999   STATE_CHECK_SP(pStatePriv);
1000
1001   (*pStatePriv->PolySegmentThinSolid)(pDrawable, pGC, nseg,
1002				       pSeg);
1003}
1004
1005static void XAAStateWrapPolylinesThinDashed(DrawablePtr pDrawable, GCPtr pGC, int mode,
1006					    int npt, DDXPointPtr pPts)
1007{
1008   GET_STATEPRIV_GC(pGC);
1009   STATE_CHECK_SP(pStatePriv);
1010
1011   (*pStatePriv->PolylinesThinDashed)(pDrawable, pGC, mode,
1012				      npt, pPts);
1013}
1014
1015static void XAAStateWrapPolySegmentThinDashed(DrawablePtr pDrawable, GCPtr pGC, int nseg,
1016					      xSegment *pSeg)
1017{
1018   GET_STATEPRIV_GC(pGC);
1019   STATE_CHECK_SP(pStatePriv);
1020
1021   (*pStatePriv->PolySegmentThinDashed)(pDrawable, pGC, nseg,
1022					pSeg);
1023}
1024
1025static void XAAStateWrapFillPolygonSolid(DrawablePtr pDrawable, GCPtr pGC, int shape,
1026					 int mode, int count, DDXPointPtr ptsIn)
1027{
1028   GET_STATEPRIV_GC(pGC);
1029   STATE_CHECK_SP(pStatePriv);
1030
1031   (*pStatePriv->FillPolygonSolid)(pDrawable, pGC, shape,
1032				   mode, count, ptsIn);
1033}
1034
1035static void XAAStateWrapFillPolygonStippled(DrawablePtr pDrawable, GCPtr pGC, int shape,
1036					    int mode, int count, DDXPointPtr ptsIn)
1037{
1038   GET_STATEPRIV_GC(pGC);
1039   STATE_CHECK_SP(pStatePriv);
1040
1041   (*pStatePriv->FillPolygonStippled)(pDrawable, pGC, shape,
1042				      mode, count, ptsIn);
1043}
1044
1045static void XAAStateWrapFillPolygonOpaqueStippled(DrawablePtr pDrawable, GCPtr pGC,
1046						  int shape, int mode, int count,
1047						  DDXPointPtr ptsIn)
1048{
1049   GET_STATEPRIV_GC(pGC);
1050   STATE_CHECK_SP(pStatePriv);
1051
1052   (*pStatePriv->FillPolygonOpaqueStippled)(pDrawable, pGC,
1053					    shape, mode, count,
1054					    ptsIn);
1055}
1056
1057static void XAAStateWrapFillPolygonTiled(DrawablePtr pDrawable, GCPtr pGC, int shape,
1058					 int mode, int count, DDXPointPtr ptsIn)
1059{
1060   GET_STATEPRIV_GC(pGC);
1061   STATE_CHECK_SP(pStatePriv);
1062
1063   (*pStatePriv->FillPolygonTiled)(pDrawable, pGC, shape,
1064				   mode, count, ptsIn);
1065}
1066
1067static void XAAStateWrapPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs,
1068					 xArc *parcs)
1069{
1070   GET_STATEPRIV_GC(pGC);
1071   STATE_CHECK_SP(pStatePriv);
1072
1073   (*pStatePriv->PolyFillArcSolid)(pDraw, pGC, narcs,
1074				   parcs);
1075}
1076
1077static void XAAStateWrapPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y,
1078				 int w, int h, int leftPad, int format, char *pImage)
1079{
1080   GET_STATEPRIV_GC(pGC);
1081   STATE_CHECK_SP(pStatePriv);
1082
1083   (*pStatePriv->PutImage)(pDraw, pGC, depth, x, y,
1084			   w, h, leftPad, format, pImage);
1085}
1086
1087static void XAAStateWrapValidateFillSpans(GCPtr pGC, unsigned long changes,
1088					  DrawablePtr pDraw)
1089{
1090   GET_STATEPRIV_GC(pGC);
1091   STATE_CHECK_SP(pStatePriv);
1092
1093   (*pStatePriv->ValidateFillSpans)(pGC, changes,
1094				    pDraw);
1095}
1096
1097static void XAAStateWrapValidateSetSpans(GCPtr pGC, unsigned long changes,
1098					 DrawablePtr pDraw)
1099{
1100   GET_STATEPRIV_GC(pGC);
1101   STATE_CHECK_SP(pStatePriv);
1102
1103   (*pStatePriv->ValidateSetSpans)(pGC, changes,
1104				   pDraw);
1105}
1106
1107static void XAAStateWrapValidatePutImage(GCPtr pGC, unsigned long changes,
1108					 DrawablePtr pDraw)
1109{
1110   GET_STATEPRIV_GC(pGC);
1111   STATE_CHECK_SP(pStatePriv);
1112
1113   (*pStatePriv->ValidatePutImage)(pGC, changes,
1114				   pDraw);
1115}
1116
1117static void XAAStateWrapValidateCopyArea(GCPtr pGC, unsigned long changes,
1118					 DrawablePtr pDraw)
1119{
1120   GET_STATEPRIV_GC(pGC);
1121   STATE_CHECK_SP(pStatePriv);
1122
1123   (*pStatePriv->ValidateCopyArea)(pGC, changes,
1124				   pDraw);
1125}
1126
1127static void XAAStateWrapValidateCopyPlane(GCPtr pGC, unsigned long changes,
1128					  DrawablePtr pDraw)
1129{
1130   GET_STATEPRIV_GC(pGC);
1131   STATE_CHECK_SP(pStatePriv);
1132
1133   (*pStatePriv->ValidateCopyPlane)(pGC, changes,
1134				    pDraw);
1135}
1136
1137static void XAAStateWrapValidatePolyPoint(GCPtr pGC, unsigned long changes,
1138					  DrawablePtr pDraw)
1139{
1140   GET_STATEPRIV_GC(pGC);
1141   STATE_CHECK_SP(pStatePriv);
1142
1143   (*pStatePriv->ValidatePolyPoint)(pGC, changes,
1144				    pDraw);
1145}
1146
1147static void XAAStateWrapValidatePolylines(GCPtr pGC, unsigned long changes,
1148					  DrawablePtr pDraw)
1149{
1150   GET_STATEPRIV_GC(pGC);
1151   STATE_CHECK_SP(pStatePriv);
1152
1153   (*pStatePriv->ValidatePolylines)(pGC, changes,
1154				    pDraw);
1155}
1156
1157static void XAAStateWrapValidatePolySegment(GCPtr pGC, unsigned long changes,
1158					    DrawablePtr pDraw)
1159{
1160   GET_STATEPRIV_GC(pGC);
1161   STATE_CHECK_SP(pStatePriv);
1162
1163   (*pStatePriv->ValidatePolySegment)(pGC, changes,
1164				      pDraw);
1165}
1166
1167static void XAAStateWrapValidatePolyRectangle(GCPtr pGC, unsigned long changes,
1168					      DrawablePtr pDraw)
1169{
1170   GET_STATEPRIV_GC(pGC);
1171   STATE_CHECK_SP(pStatePriv);
1172
1173   (*pStatePriv->ValidatePolyRectangle)(pGC, changes,
1174					pDraw);
1175}
1176
1177static void XAAStateWrapValidatePolyArc(GCPtr pGC, unsigned long changes,
1178					DrawablePtr pDraw)
1179{
1180   GET_STATEPRIV_GC(pGC);
1181   STATE_CHECK_SP(pStatePriv);
1182
1183   (*pStatePriv->ValidatePolyArc)(pGC, changes,
1184				  pDraw);
1185}
1186
1187static void XAAStateWrapValidateFillPolygon(GCPtr pGC, unsigned long changes,
1188					    DrawablePtr pDraw)
1189{
1190   GET_STATEPRIV_GC(pGC);
1191   STATE_CHECK_SP(pStatePriv);
1192
1193   (*pStatePriv->ValidateFillPolygon)(pGC, changes,
1194				      pDraw);
1195}
1196
1197static void XAAStateWrapValidatePolyFillRect(GCPtr pGC, unsigned long changes,
1198					     DrawablePtr pDraw)
1199{
1200   GET_STATEPRIV_GC(pGC);
1201   STATE_CHECK_SP(pStatePriv);
1202
1203   (*pStatePriv->ValidatePolyFillRect)(pGC, changes,
1204				       pDraw);
1205}
1206
1207static void XAAStateWrapValidatePolyFillArc(GCPtr pGC, unsigned long changes,
1208					    DrawablePtr pDraw)
1209{
1210   GET_STATEPRIV_GC(pGC);
1211   STATE_CHECK_SP(pStatePriv);
1212
1213   (*pStatePriv->ValidatePolyFillArc)(pGC, changes,
1214				      pDraw);
1215}
1216
1217static void XAAStateWrapValidatePolyText8(GCPtr pGC, unsigned long changes,
1218					  DrawablePtr pDraw)
1219{
1220   GET_STATEPRIV_GC(pGC);
1221   STATE_CHECK_SP(pStatePriv);
1222
1223   (*pStatePriv->ValidatePolyText8)(pGC, changes,
1224				    pDraw);
1225}
1226
1227static void XAAStateWrapValidatePolyText16(GCPtr pGC, unsigned long changes,
1228					   DrawablePtr pDraw)
1229{
1230   GET_STATEPRIV_GC(pGC);
1231   STATE_CHECK_SP(pStatePriv);
1232
1233   (*pStatePriv->ValidatePolyText16)(pGC, changes,
1234				     pDraw);
1235}
1236
1237static void XAAStateWrapValidateImageText8(GCPtr pGC, unsigned long changes,
1238					   DrawablePtr pDraw)
1239{
1240   GET_STATEPRIV_GC(pGC);
1241   STATE_CHECK_SP(pStatePriv);
1242
1243   (*pStatePriv->ValidateImageText8)(pGC, changes,
1244				     pDraw);
1245}
1246
1247static void XAAStateWrapValidateImageText16(GCPtr pGC, unsigned long changes,
1248					    DrawablePtr pDraw)
1249{
1250   GET_STATEPRIV_GC(pGC);
1251   STATE_CHECK_SP(pStatePriv);
1252
1253   (*pStatePriv->ValidateImageText16)(pGC, changes,
1254				      pDraw);
1255}
1256
1257static void XAAStateWrapValidatePolyGlyphBlt(GCPtr pGC, unsigned long changes,
1258					     DrawablePtr pDraw)
1259{
1260   GET_STATEPRIV_GC(pGC);
1261   STATE_CHECK_SP(pStatePriv);
1262
1263   (*pStatePriv->ValidatePolyGlyphBlt)(pGC, changes,
1264				       pDraw);
1265}
1266
1267static void XAAStateWrapValidateImageGlyphBlt(GCPtr pGC, unsigned long changes,
1268					      DrawablePtr pDraw)
1269{
1270   GET_STATEPRIV_GC(pGC);
1271   STATE_CHECK_SP(pStatePriv);
1272   (*pStatePriv->ValidateImageGlyphBlt)(pGC, changes,
1273					pDraw);
1274}
1275
1276static void XAAStateWrapValidatePushPixels(GCPtr pGC, unsigned long changes,
1277					   DrawablePtr pDraw)
1278{
1279   GET_STATEPRIV_GC(pGC);
1280   STATE_CHECK_SP(pStatePriv);
1281
1282   (*pStatePriv->ValidatePushPixels)(pGC, changes,
1283				     pDraw);
1284}
1285
1286static void XAAStateWrapComputeDash(GCPtr pGC)
1287{
1288   GET_STATEPRIV_GC(pGC);
1289   STATE_CHECK_SP(pStatePriv);
1290
1291   (*pStatePriv->ComputeDash)(pGC);
1292}
1293
1294static void XAAStateWrapInitPixmapCache(ScreenPtr pScreen, RegionPtr areas,
1295					pointer data)
1296{
1297   GET_STATEPRIV_SCREEN(pScreen);
1298   STATE_CHECK_SP(pStatePriv);
1299
1300   (*pStatePriv->InitPixmapCache)(pScreen, areas,
1301				  data);
1302}
1303
1304static void XAAStateWrapClosePixmapCache(ScreenPtr pScreen)
1305{
1306   GET_STATEPRIV_SCREEN(pScreen);
1307   STATE_CHECK_SP(pStatePriv);
1308
1309   (*pStatePriv->ClosePixmapCache)(pScreen);
1310}
1311
1312static int XAAStateWrapStippledFillChooser(GCPtr pGC)
1313{
1314   GET_STATEPRIV_GC(pGC);
1315   STATE_CHECK_SP(pStatePriv);
1316
1317   return (*pStatePriv->StippledFillChooser)(pGC);
1318}
1319
1320static int XAAStateWrapOpaqueStippledFillChooser(GCPtr pGC)
1321{
1322   GET_STATEPRIV_GC(pGC);
1323   STATE_CHECK_SP(pStatePriv);
1324
1325   return (*pStatePriv->OpaqueStippledFillChooser)(pGC);
1326}
1327
1328static int XAAStateWrapTiledFillChooser(GCPtr pGC)
1329{
1330   GET_STATEPRIV_GC(pGC);
1331   STATE_CHECK_SP(pStatePriv);
1332
1333   return (*pStatePriv->TiledFillChooser)(pGC);
1334}
1335
1336static XAACacheInfoPtr XAAStateWrapCacheTile(ScrnInfoPtr pScrn, PixmapPtr pPix)
1337{
1338   GET_STATEPRIV_PSCRN(pScrn);
1339   STATE_CHECK_PSCRN(pScrn);
1340
1341   return (*pStatePriv->CacheTile)(pScrn, pPix);
1342}
1343
1344static XAACacheInfoPtr XAAStateWrapCacheStipple(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg,
1345						int bg)
1346{
1347   GET_STATEPRIV_PSCRN(pScrn);
1348   STATE_CHECK_PSCRN(pScrn);
1349
1350   return (*pStatePriv->CacheStipple)(pScrn, pPix, fg,
1351				      bg);
1352}
1353
1354static XAACacheInfoPtr XAAStateWrapCacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix)
1355{
1356   GET_STATEPRIV_PSCRN(pScrn);
1357   STATE_CHECK_PSCRN(pScrn);
1358
1359   return (*pStatePriv->CacheMonoStipple)(pScrn, pPix);
1360}
1361
1362static XAACacheInfoPtr XAAStateWrapCacheMono8x8Pattern(ScrnInfoPtr pScrn, int pat0,
1363						       int pat1)
1364{
1365   GET_STATEPRIV_PSCRN(pScrn);
1366   STATE_CHECK_PSCRN(pScrn);
1367
1368   return (*pStatePriv->CacheMono8x8Pattern)(pScrn, pat0,
1369					     pat1);
1370}
1371
1372static XAACacheInfoPtr XAAStateWrapCacheColor8x8Pattern(ScrnInfoPtr pScrn, PixmapPtr pPix,
1373							int fg, int bg)
1374{
1375   GET_STATEPRIV_PSCRN(pScrn);
1376   STATE_CHECK_PSCRN(pScrn);
1377
1378   return (*pStatePriv->CacheColor8x8Pattern)(pScrn, pPix,
1379					      fg, bg);
1380}
1381
1382static void XAAStateWrapWriteBitmapToCache(ScrnInfoPtr pScrn, int x, int y, int w, int h,
1383					   unsigned char *src, int srcwidth, int fg,
1384					   int bg)
1385{
1386   GET_STATEPRIV_PSCRN(pScrn);
1387   STATE_CHECK_PSCRN(pScrn);
1388
1389   (*pStatePriv->WriteBitmapToCache)(pScrn, x, y, w, h,
1390				     src, srcwidth, fg,
1391				     bg);
1392}
1393
1394static void XAAStateWrapWritePixmapToCache(ScrnInfoPtr pScrn, int x, int y, int w, int h,
1395					   unsigned char *src, int srcwidth, int bpp,
1396					   int depth)
1397{
1398   GET_STATEPRIV_PSCRN(pScrn);
1399   STATE_CHECK_PSCRN(pScrn);
1400
1401   (*pStatePriv->WritePixmapToCache)(pScrn, x, y, w, h,
1402				     src, srcwidth, bpp,
1403				     depth);
1404}
1405
1406static void XAAStateWrapWriteMono8x8PatternToCache(ScrnInfoPtr pScrn,
1407						   XAACacheInfoPtr pCache)
1408{
1409   GET_STATEPRIV_PSCRN(pScrn);
1410   STATE_CHECK_PSCRN(pScrn);
1411
1412   (*pStatePriv->WriteMono8x8PatternToCache)(pScrn,
1413					     pCache);
1414}
1415
1416static void XAAStateWrapWriteColor8x8PatternToCache(ScrnInfoPtr pScrn, PixmapPtr pPix,
1417						    XAACacheInfoPtr pCache)
1418{
1419   GET_STATEPRIV_PSCRN(pScrn);
1420   STATE_CHECK_PSCRN(pScrn);
1421
1422   (*pStatePriv->WriteColor8x8PatternToCache)(pScrn, pPix,
1423					      pCache);
1424}
1425
1426static void XAAStateWrapGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
1427				 unsigned int format,unsigned long planeMask,
1428				 char *pdstLine)
1429{
1430   GET_STATEPRIV_SCREEN(pDrawable->pScreen);
1431   STATE_CHECK_SP(pStatePriv);
1432
1433   (*pStatePriv->GetImage)(pDrawable, sx, sy, w, h,
1434			   format, planeMask,
1435			   pdstLine);
1436}
1437
1438static void XAAStateWrapGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
1439				 int *pwidth, int nspans, char *pdstStart)
1440{
1441   GET_STATEPRIV_SCREEN(pDrawable->pScreen);
1442   STATE_CHECK_SP(pStatePriv);
1443
1444   (*pStatePriv->GetSpans)(pDrawable, wMax, ppt,
1445			   pwidth, nspans, pdstStart);
1446}
1447
1448static void XAAStateWrapCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg,
1449				   RegionPtr prgnSrc)
1450{
1451   GET_STATEPRIV_SCREEN(pWindow->drawable.pScreen);
1452   STATE_CHECK_SP(pStatePriv);
1453
1454   (*pStatePriv->CopyWindow)(pWindow, ptOldOrg,
1455			     prgnSrc);
1456}
1457
1458static Bool XAAStateWrapSetupForCPUToScreenAlphaTexture2(ScrnInfoPtr pScrn,
1459                                                         int op, CARD16 red,
1460                                                         CARD16 green,
1461                                                         CARD16 blue,
1462                                                         CARD16 alpha,
1463							 CARD32 srcFormat,
1464							 CARD32 dstFormat,
1465                                                         CARD8 *alphaPtr,
1466                                                         int alphaPitch,
1467                                                         int width, int height,
1468                                                         int flags)
1469{
1470   GET_STATEPRIV_PSCRN(pScrn);
1471   STATE_CHECK_PSCRN(pScrn);
1472
1473   return (*pStatePriv->SetupForCPUToScreenAlphaTexture2)(pScrn, op, red, green,
1474                                                         blue, alpha, srcFormat,
1475							 dstFormat, alphaPtr,
1476							 alphaPitch, width,
1477							 height, flags);
1478}
1479
1480static Bool XAAStateWrapSetupForCPUToScreenTexture2(ScrnInfoPtr pScrn, int op,
1481                                                    CARD32 srcFormat,
1482						    CARD32 dstFormat,
1483						    CARD8 *texPtr, int texPitch,
1484                                                    int width, int height,
1485                                                    int flags)
1486{
1487   GET_STATEPRIV_PSCRN(pScrn);
1488   STATE_CHECK_PSCRN(pScrn);
1489
1490   return (*pStatePriv->SetupForCPUToScreenTexture2)(pScrn, op, srcFormat,
1491                                                    dstFormat, texPtr, texPitch,
1492						    width, height, flags);
1493}
1494
1495/* Setup Function */
1496Bool
1497XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
1498{
1499   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
1500   XAAStateWrapPtr pStatePriv;
1501   int i = 0;
1502
1503   if (!dixRegisterPrivateKey(&XAAStateKeyRec, PRIVATE_SCREEN, 0)) return FALSE;
1504   if(!(pStatePriv = malloc(sizeof(XAAStateWrapRec)))) return FALSE;
1505   dixSetPrivate(&pScreen->devPrivates, XAAStateKey, pStatePriv);
1506   pStatePriv->RestoreAccelState = infoRec->RestoreAccelState;
1507   pStatePriv->pScrn = pScrn;
1508
1509   /* Initialize the last screen to -1 so whenever an accel function
1510    * is called the proper state is setup
1511    */
1512   while(i < pScrn->numEntities) {
1513      xf86SetLastScrnFlag(pScrn->entityList[i], -1);
1514      i++;
1515   }
1516/* Do the wrapping */
1517   XAA_STATE_WRAP(Sync);
1518   XAA_STATE_WRAP(SetupForScreenToScreenCopy);
1519   XAA_STATE_WRAP(SetupForSolidFill);
1520   XAA_STATE_WRAP(SetupForSolidLine);
1521   XAA_STATE_WRAP(SetupForDashedLine);
1522   XAA_STATE_WRAP(SetClippingRectangle);
1523   XAA_STATE_WRAP(DisableClipping);
1524   XAA_STATE_WRAP(SetupForMono8x8PatternFill);
1525   XAA_STATE_WRAP(SetupForColor8x8PatternFill);
1526   XAA_STATE_WRAP(SetupForCPUToScreenColorExpandFill);
1527   XAA_STATE_WRAP(SetupForScanlineCPUToScreenColorExpandFill);
1528   XAA_STATE_WRAP(SetupForScreenToScreenColorExpandFill);
1529   XAA_STATE_WRAP(SetupForImageWrite);
1530   XAA_STATE_WRAP(SetupForScanlineImageWrite);
1531   XAA_STATE_WRAP(SetupForImageRead);
1532   XAA_STATE_WRAP(ScreenToScreenBitBlt);
1533   XAA_STATE_WRAP(WriteBitmap);
1534   XAA_STATE_WRAP(FillSolidRects);
1535   XAA_STATE_WRAP(FillMono8x8PatternRects);
1536   XAA_STATE_WRAP(FillColor8x8PatternRects);
1537   XAA_STATE_WRAP(FillCacheBltRects);
1538   XAA_STATE_WRAP(FillColorExpandRects);
1539   XAA_STATE_WRAP(FillCacheExpandRects);
1540   XAA_STATE_WRAP(FillImageWriteRects);
1541   XAA_STATE_WRAP(FillSolidSpans);
1542   XAA_STATE_WRAP(FillMono8x8PatternSpans);
1543   XAA_STATE_WRAP(FillColor8x8PatternSpans);
1544   XAA_STATE_WRAP(FillCacheBltSpans);
1545   XAA_STATE_WRAP(FillColorExpandSpans);
1546   XAA_STATE_WRAP(FillCacheExpandSpans);
1547   XAA_STATE_WRAP(TEGlyphRenderer);
1548   XAA_STATE_WRAP(NonTEGlyphRenderer);
1549   XAA_STATE_WRAP(WritePixmap);
1550   XAA_STATE_WRAP(ReadPixmap);
1551   XAA_STATE_WRAP(CopyArea);
1552   XAA_STATE_WRAP(CopyPlane);
1553   XAA_STATE_WRAP(PushPixelsSolid);
1554   XAA_STATE_WRAP(PolyFillRectSolid);
1555   XAA_STATE_WRAP(PolyFillRectStippled);
1556   XAA_STATE_WRAP(PolyFillRectOpaqueStippled);
1557   XAA_STATE_WRAP(PolyFillRectTiled);
1558   XAA_STATE_WRAP(FillSpansSolid);
1559   XAA_STATE_WRAP(FillSpansStippled);
1560   XAA_STATE_WRAP(FillSpansOpaqueStippled);
1561   XAA_STATE_WRAP(FillSpansTiled);
1562   XAA_STATE_WRAP(PolyText8TE);
1563   XAA_STATE_WRAP(PolyText16TE);
1564   XAA_STATE_WRAP(ImageText8TE);
1565   XAA_STATE_WRAP(ImageText16TE);
1566   XAA_STATE_WRAP(ImageGlyphBltTE);
1567   XAA_STATE_WRAP(PolyGlyphBltTE);
1568   XAA_STATE_WRAP(PolyText8NonTE);
1569   XAA_STATE_WRAP(PolyText16NonTE);
1570   XAA_STATE_WRAP(ImageText8NonTE);
1571   XAA_STATE_WRAP(ImageText16NonTE);
1572   XAA_STATE_WRAP(ImageGlyphBltNonTE);
1573   XAA_STATE_WRAP(PolyGlyphBltNonTE);
1574   XAA_STATE_WRAP(PolyRectangleThinSolid);
1575   XAA_STATE_WRAP(PolylinesWideSolid);
1576   XAA_STATE_WRAP(PolylinesThinSolid);
1577   XAA_STATE_WRAP(PolySegmentThinSolid);
1578   XAA_STATE_WRAP(PolylinesThinDashed);
1579   XAA_STATE_WRAP(PolySegmentThinDashed);
1580   XAA_STATE_WRAP(FillPolygonSolid);
1581   XAA_STATE_WRAP(FillPolygonStippled);
1582   XAA_STATE_WRAP(FillPolygonOpaqueStippled);
1583   XAA_STATE_WRAP(FillPolygonTiled);
1584   XAA_STATE_WRAP(PolyFillArcSolid);
1585   XAA_STATE_WRAP(PutImage);
1586   XAA_STATE_WRAP(ValidateFillSpans);
1587   XAA_STATE_WRAP(ValidateSetSpans);
1588   XAA_STATE_WRAP(ValidatePutImage);
1589   XAA_STATE_WRAP(ValidateCopyArea);
1590   XAA_STATE_WRAP(ValidateCopyPlane);
1591   XAA_STATE_WRAP(ValidatePolyPoint);
1592   XAA_STATE_WRAP(ValidatePolylines);
1593   XAA_STATE_WRAP(ValidatePolySegment);
1594   XAA_STATE_WRAP(ValidatePolyRectangle);
1595   XAA_STATE_WRAP(ValidatePolyArc);
1596   XAA_STATE_WRAP(ValidateFillPolygon);
1597   XAA_STATE_WRAP(ValidatePolyFillRect);
1598   XAA_STATE_WRAP(ValidatePolyFillArc);
1599   XAA_STATE_WRAP(ValidatePolyText8);
1600   XAA_STATE_WRAP(ValidatePolyText16);
1601   XAA_STATE_WRAP(ValidateImageText8);
1602   XAA_STATE_WRAP(ValidateImageText16);
1603   XAA_STATE_WRAP(ValidatePolyGlyphBlt);
1604   XAA_STATE_WRAP(ValidateImageGlyphBlt);
1605   XAA_STATE_WRAP(ValidatePushPixels);
1606   XAA_STATE_WRAP(ComputeDash);
1607   XAA_STATE_WRAP(InitPixmapCache);
1608   XAA_STATE_WRAP(ClosePixmapCache);
1609   XAA_STATE_WRAP(StippledFillChooser);
1610   XAA_STATE_WRAP(OpaqueStippledFillChooser);
1611   XAA_STATE_WRAP(TiledFillChooser);
1612   XAA_STATE_WRAP(CacheTile);
1613   XAA_STATE_WRAP(CacheStipple);
1614   XAA_STATE_WRAP(CacheMonoStipple);
1615   XAA_STATE_WRAP(CacheMono8x8Pattern);
1616   XAA_STATE_WRAP(CacheColor8x8Pattern);
1617   XAA_STATE_WRAP(WriteBitmapToCache);
1618   XAA_STATE_WRAP(WritePixmapToCache);
1619   XAA_STATE_WRAP(WriteMono8x8PatternToCache);
1620   XAA_STATE_WRAP(WriteColor8x8PatternToCache);
1621   XAA_STATE_WRAP(GetImage);
1622   XAA_STATE_WRAP(GetSpans);
1623   XAA_STATE_WRAP(CopyWindow);
1624   XAA_STATE_WRAP(SetupForCPUToScreenAlphaTexture2);
1625   XAA_STATE_WRAP(SetupForCPUToScreenTexture2);
1626   return TRUE;
1627}
1628