xref: /OK3568_Linux_fs/external/xserver/hw/xfree86/common/xf86VGAarbiterPriv.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright (c) 2009 Tiago Vignatti
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Permission is hereby granted, free of charge, to any person
5*4882a593Smuzhiyun  * obtaining a copy of this software and associated documentation
6*4882a593Smuzhiyun  * files (the "Software"), to deal in the Software without
7*4882a593Smuzhiyun  * restriction, including without limitation the rights to use,
8*4882a593Smuzhiyun  * copy, modify, merge, publish, distribute, sublicense, and/or sell
9*4882a593Smuzhiyun  * copies of the Software, and to permit persons to whom the
10*4882a593Smuzhiyun  * Software is furnished to do so, subject to the following
11*4882a593Smuzhiyun  * conditions:
12*4882a593Smuzhiyun  *
13*4882a593Smuzhiyun  * The above copyright notice and this permission notice shall be
14*4882a593Smuzhiyun  * included in all copies or substantial portions of the Software.
15*4882a593Smuzhiyun  *
16*4882a593Smuzhiyun  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17*4882a593Smuzhiyun  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18*4882a593Smuzhiyun  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19*4882a593Smuzhiyun  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20*4882a593Smuzhiyun  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21*4882a593Smuzhiyun  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22*4882a593Smuzhiyun  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23*4882a593Smuzhiyun  * OTHER DEALINGS IN THE SOFTWARE.
24*4882a593Smuzhiyun  *
25*4882a593Smuzhiyun  */
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun #ifdef HAVE_XORG_CONFIG_H
28*4882a593Smuzhiyun #include <xorg-config.h>
29*4882a593Smuzhiyun #endif
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun #include "misc.h"
32*4882a593Smuzhiyun #include "xf86.h"
33*4882a593Smuzhiyun #include "xf86_OSproc.h"
34*4882a593Smuzhiyun #include <X11/X.h>
35*4882a593Smuzhiyun #include "colormapst.h"
36*4882a593Smuzhiyun #include "scrnintstr.h"
37*4882a593Smuzhiyun #include "screenint.h"
38*4882a593Smuzhiyun #include "gcstruct.h"
39*4882a593Smuzhiyun #include "pixmapstr.h"
40*4882a593Smuzhiyun #include "pixmap.h"
41*4882a593Smuzhiyun #include "windowstr.h"
42*4882a593Smuzhiyun #include "window.h"
43*4882a593Smuzhiyun #include "xf86str.h"
44*4882a593Smuzhiyun #include "mipointer.h"
45*4882a593Smuzhiyun #include "mipointrst.h"
46*4882a593Smuzhiyun #include "picturestr.h"
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun #define WRAP_SCREEN(x,y) {pScreenPriv->x = pScreen->x; pScreen->x = y;}
49*4882a593Smuzhiyun 
50*4882a593Smuzhiyun #define UNWRAP_SCREEN(x) pScreen->x = pScreenPriv->x
51*4882a593Smuzhiyun 
52*4882a593Smuzhiyun #define SCREEN_PRIV()   ((VGAarbiterScreenPtr) dixLookupPrivate(&(pScreen)->devPrivates, VGAarbiterScreenKey))
53*4882a593Smuzhiyun 
54*4882a593Smuzhiyun #define SCREEN_PROLOG(x) (pScreen->x = SCREEN_PRIV()->x)
55*4882a593Smuzhiyun 
56*4882a593Smuzhiyun #define SCREEN_EPILOG(x,y) do {                 \
57*4882a593Smuzhiyun         SCREEN_PRIV()->x = pScreen->x;          \
58*4882a593Smuzhiyun         pScreen->x = y;                         \
59*4882a593Smuzhiyun     } while (0)
60*4882a593Smuzhiyun 
61*4882a593Smuzhiyun #define WRAP_PICT(x,y) if (ps) {pScreenPriv->x = ps->x;\
62*4882a593Smuzhiyun     ps->x = y;}
63*4882a593Smuzhiyun 
64*4882a593Smuzhiyun #define UNWRAP_PICT(x) if (ps) {ps->x = pScreenPriv->x;}
65*4882a593Smuzhiyun 
66*4882a593Smuzhiyun #define PICTURE_PROLOGUE(field) ps->field = \
67*4882a593Smuzhiyun     ((VGAarbiterScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \
68*4882a593Smuzhiyun     VGAarbiterScreenKey))->field
69*4882a593Smuzhiyun 
70*4882a593Smuzhiyun #define PICTURE_EPILOGUE(field, wrap) ps->field = wrap
71*4882a593Smuzhiyun 
72*4882a593Smuzhiyun #define WRAP_SCREEN_INFO(x,y) do {pScreenPriv->x = pScrn->x; pScrn->x = y;} while(0)
73*4882a593Smuzhiyun 
74*4882a593Smuzhiyun #define UNWRAP_SCREEN_INFO(x) pScrn->x = pScreenPriv->x
75*4882a593Smuzhiyun 
76*4882a593Smuzhiyun #define SPRITE_PROLOG                                           \
77*4882a593Smuzhiyun     miPointerScreenPtr PointPriv;                               \
78*4882a593Smuzhiyun     VGAarbiterScreenPtr pScreenPriv;                            \
79*4882a593Smuzhiyun     input_lock();                                               \
80*4882a593Smuzhiyun     PointPriv = dixLookupPrivate(&pScreen->devPrivates,         \
81*4882a593Smuzhiyun                                  miPointerScreenKey);           \
82*4882a593Smuzhiyun     pScreenPriv = dixLookupPrivate(&(pScreen)->devPrivates,     \
83*4882a593Smuzhiyun                                    VGAarbiterScreenKey);        \
84*4882a593Smuzhiyun     PointPriv->spriteFuncs = pScreenPriv->miSprite;             \
85*4882a593Smuzhiyun 
86*4882a593Smuzhiyun #define SPRITE_EPILOG                                   \
87*4882a593Smuzhiyun     pScreenPriv->miSprite = PointPriv->spriteFuncs;     \
88*4882a593Smuzhiyun     PointPriv->spriteFuncs  = &VGAarbiterSpriteFuncs;   \
89*4882a593Smuzhiyun     input_unlock();
90*4882a593Smuzhiyun 
91*4882a593Smuzhiyun #define WRAP_SPRITE do { pScreenPriv->miSprite = PointPriv->spriteFuncs;\
92*4882a593Smuzhiyun     	PointPriv->spriteFuncs  = &VGAarbiterSpriteFuncs; 		\
93*4882a593Smuzhiyun 	} while (0)
94*4882a593Smuzhiyun 
95*4882a593Smuzhiyun #define UNWRAP_SPRITE PointPriv->spriteFuncs = pScreenPriv->miSprite
96*4882a593Smuzhiyun 
97*4882a593Smuzhiyun #define GC_WRAP(x) pGCPriv->wrapOps = (x)->ops;\
98*4882a593Smuzhiyun     pGCPriv->wrapFuncs = (x)->funcs; (x)->ops = &VGAarbiterGCOps;\
99*4882a593Smuzhiyun     (x)->funcs = &VGAarbiterGCFuncs;
100*4882a593Smuzhiyun 
101*4882a593Smuzhiyun #define GC_UNWRAP(x) VGAarbiterGCPtr  pGCPriv = \
102*4882a593Smuzhiyun     (VGAarbiterGCPtr)dixLookupPrivate(&(x)->devPrivates, VGAarbiterGCKey);\
103*4882a593Smuzhiyun     (x)->ops = pGCPriv->wrapOps; (x)->funcs = pGCPriv->wrapFuncs;
104*4882a593Smuzhiyun 
105*4882a593Smuzhiyun static inline void
VGAGet(ScreenPtr pScreen)106*4882a593Smuzhiyun VGAGet(ScreenPtr pScreen)
107*4882a593Smuzhiyun {
108*4882a593Smuzhiyun     pci_device_vgaarb_set_target(xf86ScreenToScrn(pScreen)->vgaDev);
109*4882a593Smuzhiyun     pci_device_vgaarb_lock();
110*4882a593Smuzhiyun }
111*4882a593Smuzhiyun 
112*4882a593Smuzhiyun static inline void
VGAPut(void)113*4882a593Smuzhiyun VGAPut(void)
114*4882a593Smuzhiyun {
115*4882a593Smuzhiyun     pci_device_vgaarb_unlock();
116*4882a593Smuzhiyun }
117*4882a593Smuzhiyun 
118*4882a593Smuzhiyun typedef struct _VGAarbiterScreen {
119*4882a593Smuzhiyun     CreateGCProcPtr CreateGC;
120*4882a593Smuzhiyun     CloseScreenProcPtr CloseScreen;
121*4882a593Smuzhiyun     ScreenBlockHandlerProcPtr BlockHandler;
122*4882a593Smuzhiyun     ScreenWakeupHandlerProcPtr WakeupHandler;
123*4882a593Smuzhiyun     GetImageProcPtr GetImage;
124*4882a593Smuzhiyun     GetSpansProcPtr GetSpans;
125*4882a593Smuzhiyun     SourceValidateProcPtr SourceValidate;
126*4882a593Smuzhiyun     CopyWindowProcPtr CopyWindow;
127*4882a593Smuzhiyun     ClearToBackgroundProcPtr ClearToBackground;
128*4882a593Smuzhiyun     CreatePixmapProcPtr CreatePixmap;
129*4882a593Smuzhiyun     SaveScreenProcPtr SaveScreen;
130*4882a593Smuzhiyun     /* Colormap */
131*4882a593Smuzhiyun     StoreColorsProcPtr StoreColors;
132*4882a593Smuzhiyun     /* Cursor */
133*4882a593Smuzhiyun     DisplayCursorProcPtr DisplayCursor;
134*4882a593Smuzhiyun     RealizeCursorProcPtr RealizeCursor;
135*4882a593Smuzhiyun     UnrealizeCursorProcPtr UnrealizeCursor;
136*4882a593Smuzhiyun     RecolorCursorProcPtr RecolorCursor;
137*4882a593Smuzhiyun     SetCursorPositionProcPtr SetCursorPosition;
138*4882a593Smuzhiyun     void (*AdjustFrame) (ScrnInfoPtr, int, int);
139*4882a593Smuzhiyun     Bool (*SwitchMode) (ScrnInfoPtr, DisplayModePtr);
140*4882a593Smuzhiyun     Bool (*EnterVT) (ScrnInfoPtr);
141*4882a593Smuzhiyun     void (*LeaveVT) (ScrnInfoPtr);
142*4882a593Smuzhiyun     void (*FreeScreen) (ScrnInfoPtr);
143*4882a593Smuzhiyun     miPointerSpriteFuncPtr miSprite;
144*4882a593Smuzhiyun     CompositeProcPtr Composite;
145*4882a593Smuzhiyun     GlyphsProcPtr Glyphs;
146*4882a593Smuzhiyun     CompositeRectsProcPtr CompositeRects;
147*4882a593Smuzhiyun } VGAarbiterScreenRec, *VGAarbiterScreenPtr;
148*4882a593Smuzhiyun 
149*4882a593Smuzhiyun typedef struct _VGAarbiterGC {
150*4882a593Smuzhiyun     const GCOps *wrapOps;
151*4882a593Smuzhiyun     const GCFuncs *wrapFuncs;
152*4882a593Smuzhiyun } VGAarbiterGCRec, *VGAarbiterGCPtr;
153*4882a593Smuzhiyun 
154*4882a593Smuzhiyun /* Screen funcs */
155*4882a593Smuzhiyun static void VGAarbiterBlockHandler(ScreenPtr pScreen, void *pTimeout);
156*4882a593Smuzhiyun static void VGAarbiterWakeupHandler(ScreenPtr pScreen, int result);
157*4882a593Smuzhiyun static Bool VGAarbiterCloseScreen(ScreenPtr pScreen);
158*4882a593Smuzhiyun static void VGAarbiterGetImage(DrawablePtr pDrawable, int sx, int sy, int w,
159*4882a593Smuzhiyun                                int h, unsigned int format,
160*4882a593Smuzhiyun                                unsigned long planemask, char *pdstLine);
161*4882a593Smuzhiyun static void VGAarbiterGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
162*4882a593Smuzhiyun                                int *pwidth, int nspans, char *pdstStart);
163*4882a593Smuzhiyun static void VGAarbiterSourceValidate(DrawablePtr pDrawable, int x, int y,
164*4882a593Smuzhiyun                                      int width, int height,
165*4882a593Smuzhiyun                                      unsigned int subWindowMode);
166*4882a593Smuzhiyun static void VGAarbiterCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
167*4882a593Smuzhiyun                                  RegionPtr prgnSrc);
168*4882a593Smuzhiyun static void VGAarbiterClearToBackground(WindowPtr pWin, int x, int y, int w,
169*4882a593Smuzhiyun                                         int h, Bool generateExposures);
170*4882a593Smuzhiyun static PixmapPtr VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h,
171*4882a593Smuzhiyun                                         int depth, unsigned int usage_hint);
172*4882a593Smuzhiyun static Bool VGAarbiterCreateGC(GCPtr pGC);
173*4882a593Smuzhiyun static Bool VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank);
174*4882a593Smuzhiyun static void VGAarbiterStoreColors(ColormapPtr pmap, int ndef, xColorItem
175*4882a593Smuzhiyun                                   * pdefs);
176*4882a593Smuzhiyun static void VGAarbiterRecolorCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
177*4882a593Smuzhiyun                                     CursorPtr pCurs, Bool displayed);
178*4882a593Smuzhiyun static Bool VGAarbiterRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
179*4882a593Smuzhiyun                                     CursorPtr pCursor);
180*4882a593Smuzhiyun static Bool VGAarbiterUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
181*4882a593Smuzhiyun                                       CursorPtr pCursor);
182*4882a593Smuzhiyun static Bool VGAarbiterDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
183*4882a593Smuzhiyun                                     CursorPtr pCursor);
184*4882a593Smuzhiyun static Bool VGAarbiterSetCursorPosition(DeviceIntPtr pDev, ScreenPtr
185*4882a593Smuzhiyun                                         pScreen, int x, int y,
186*4882a593Smuzhiyun                                         Bool generateEvent);
187*4882a593Smuzhiyun static void VGAarbiterAdjustFrame(ScrnInfoPtr pScrn, int x, int y);
188*4882a593Smuzhiyun static Bool VGAarbiterSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode);
189*4882a593Smuzhiyun static Bool VGAarbiterEnterVT(ScrnInfoPtr pScrn);
190*4882a593Smuzhiyun static void VGAarbiterLeaveVT(ScrnInfoPtr pScrn);
191*4882a593Smuzhiyun static void VGAarbiterFreeScreen(ScrnInfoPtr pScrn);
192*4882a593Smuzhiyun 
193*4882a593Smuzhiyun /* GC funcs */
194*4882a593Smuzhiyun static void VGAarbiterValidateGC(GCPtr pGC, unsigned long changes,
195*4882a593Smuzhiyun                                  DrawablePtr pDraw);
196*4882a593Smuzhiyun static void VGAarbiterChangeGC(GCPtr pGC, unsigned long mask);
197*4882a593Smuzhiyun static void VGAarbiterCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
198*4882a593Smuzhiyun static void VGAarbiterDestroyGC(GCPtr pGC);
199*4882a593Smuzhiyun static void VGAarbiterChangeClip(GCPtr pGC, int type, void *pvalue,
200*4882a593Smuzhiyun                                  int nrects);
201*4882a593Smuzhiyun static void VGAarbiterDestroyClip(GCPtr pGC);
202*4882a593Smuzhiyun static void VGAarbiterCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
203*4882a593Smuzhiyun 
204*4882a593Smuzhiyun /* GC ops */
205*4882a593Smuzhiyun static void VGAarbiterFillSpans(DrawablePtr pDraw, GC * pGC, int nInit,
206*4882a593Smuzhiyun                                 DDXPointPtr pptInit, int *pwidthInit,
207*4882a593Smuzhiyun                                 int fSorted);
208*4882a593Smuzhiyun static void VGAarbiterSetSpans(DrawablePtr pDraw, GCPtr pGC, char *pcharsrc,
209*4882a593Smuzhiyun                                register DDXPointPtr ppt, int *pwidth,
210*4882a593Smuzhiyun                                int nspans, int fSorted);
211*4882a593Smuzhiyun static void VGAarbiterPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, int x,
212*4882a593Smuzhiyun                                int y, int w, int h, int leftPad, int format,
213*4882a593Smuzhiyun                                char *pImage);
214*4882a593Smuzhiyun static RegionPtr VGAarbiterCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
215*4882a593Smuzhiyun                                     GC * pGC, int srcx, int srcy, int width,
216*4882a593Smuzhiyun                                     int height, int dstx, int dsty);
217*4882a593Smuzhiyun static RegionPtr VGAarbiterCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
218*4882a593Smuzhiyun                                      GCPtr pGC, int srcx, int srcy, int width,
219*4882a593Smuzhiyun                                      int height, int dstx, int dsty,
220*4882a593Smuzhiyun                                      unsigned long bitPlane);
221*4882a593Smuzhiyun static void VGAarbiterPolyPoint(DrawablePtr pDraw, GCPtr pGC, int mode, int npt,
222*4882a593Smuzhiyun                                 xPoint * pptInit);
223*4882a593Smuzhiyun static void VGAarbiterPolylines(DrawablePtr pDraw, GCPtr pGC, int mode, int npt,
224*4882a593Smuzhiyun                                 DDXPointPtr pptInit);
225*4882a593Smuzhiyun static void VGAarbiterPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg,
226*4882a593Smuzhiyun                                   xSegment * pSeg);
227*4882a593Smuzhiyun static void VGAarbiterPolyRectangle(DrawablePtr pDraw, GCPtr pGC,
228*4882a593Smuzhiyun                                     int nRectsInit, xRectangle *pRectsInit);
229*4882a593Smuzhiyun static void VGAarbiterPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
230*4882a593Smuzhiyun                               xArc * parcs);
231*4882a593Smuzhiyun static void VGAarbiterFillPolygon(DrawablePtr pDraw, GCPtr pGC, int shape,
232*4882a593Smuzhiyun                                   int mode, int count, DDXPointPtr ptsIn);
233*4882a593Smuzhiyun static void VGAarbiterPolyFillRect(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
234*4882a593Smuzhiyun                                    xRectangle *prectInit);
235*4882a593Smuzhiyun static void VGAarbiterPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
236*4882a593Smuzhiyun                                   xArc * parcs);
237*4882a593Smuzhiyun static int VGAarbiterPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y,
238*4882a593Smuzhiyun                                int count, char *chars);
239*4882a593Smuzhiyun static int VGAarbiterPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y,
240*4882a593Smuzhiyun                                 int count, unsigned short *chars);
241*4882a593Smuzhiyun static void VGAarbiterImageText8(DrawablePtr pDraw, GCPtr pGC, int x, int y,
242*4882a593Smuzhiyun                                  int count, char *chars);
243*4882a593Smuzhiyun static void VGAarbiterImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y,
244*4882a593Smuzhiyun                                   int count, unsigned short *chars);
245*4882a593Smuzhiyun static void VGAarbiterImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit,
246*4882a593Smuzhiyun                                     int yInit, unsigned int nglyph,
247*4882a593Smuzhiyun                                     CharInfoPtr * ppci, void *pglyphBase);
248*4882a593Smuzhiyun static void VGAarbiterPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit,
249*4882a593Smuzhiyun                                    int yInit, unsigned int nglyph,
250*4882a593Smuzhiyun                                    CharInfoPtr * ppci, void *pglyphBase);
251*4882a593Smuzhiyun static void VGAarbiterPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr
252*4882a593Smuzhiyun                                  pDraw, int dx, int dy, int xOrg, int yOrg);
253*4882a593Smuzhiyun 
254*4882a593Smuzhiyun /* miSpriteFuncs */
255*4882a593Smuzhiyun static Bool VGAarbiterSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr
256*4882a593Smuzhiyun                                           pScreen, CursorPtr pCur);
257*4882a593Smuzhiyun static Bool VGAarbiterSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr
258*4882a593Smuzhiyun                                             pScreen, CursorPtr pCur);
259*4882a593Smuzhiyun static void VGAarbiterSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
260*4882a593Smuzhiyun                                       CursorPtr pCur, int x, int y);
261*4882a593Smuzhiyun static void VGAarbiterSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
262*4882a593Smuzhiyun                                        int x, int y);
263*4882a593Smuzhiyun static Bool VGAarbiterDeviceCursorInitialize(DeviceIntPtr pDev,
264*4882a593Smuzhiyun                                              ScreenPtr pScreen);
265*4882a593Smuzhiyun static void VGAarbiterDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
266*4882a593Smuzhiyun 
267*4882a593Smuzhiyun static void VGAarbiterComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
268*4882a593Smuzhiyun                                 PicturePtr pDst, INT16 xSrc, INT16 ySrc,
269*4882a593Smuzhiyun                                 INT16 xMask, INT16 yMask, INT16 xDst,
270*4882a593Smuzhiyun                                 INT16 yDst, CARD16 width, CARD16 height);
271*4882a593Smuzhiyun static void VGAarbiterGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
272*4882a593Smuzhiyun                              PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
273*4882a593Smuzhiyun                              int nlist, GlyphListPtr list, GlyphPtr * glyphs);
274*4882a593Smuzhiyun static void VGAarbiterCompositeRects(CARD8 op, PicturePtr pDst,
275*4882a593Smuzhiyun                                      xRenderColor * color, int nRect,
276*4882a593Smuzhiyun                                      xRectangle *rects);
277