1 #ifdef HAVE_XORG_CONFIG_H
2 #include <xorg-config.h>
7 #include "xf86_OSproc.h"
10 #include "colormapst.h"
11 #include "scrnintstr.h"
12 #include "screenint.h"
14 #include "pixmapstr.h"
16 #include "windowstr.h"
20 #include "mipointer.h"
21 #include "mipointrst.h"
23 # include "picturestr.h"
27 #define DPRINT_S(x,y) ErrorF(x ": %i\n",y);
28 #define DPRINT(x) ErrorF(x "\n");
34 #define WRAP_SCREEN(x,y) {pScreenPriv->x = pScreen->x;\
36 #define WRAP_SCREEN_COND(x,y,cond) \
37 {pScreenPriv->x = pScreen->x;\
40 #define UNWRAP_SCREEN(x) pScreen->x = pScreenPriv->x
42 #define SCREEN_PROLOG(x) \
44 ((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr)->x
45 #define SCREEN_EPILOG(x,y) pScreen->x = y;
47 #define WRAP_PICT_COND(x,y,cond) if (ps)\
48 {pScreenPriv->x = ps->x;\
51 #define UNWRAP_PICT(x) if (ps) {ps->x = pScreenPriv->x;}
53 #define PICTURE_PROLOGUE(field) \
55 ((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr)->field
56 #define PICTURE_EPILOGUE(field, wrap) \
59 #define WRAP_SCREEN_INFO(x,y) {pScreenPriv->x = pScrn->x;\
61 #define WRAP_SCREEN_INFO_COND(x,y,cond) \
62 {pScreenPriv->x = pScrn->x;\
65 #define UNWRAP_SCREEN_INFO(x) pScrn->x = pScreenPriv->x
67 #define SPRITE_PROLOG miPointerScreenPtr PointPriv = \
68 (miPointerScreenPtr)pScreen->devPrivates[miPointerScreenIndex].ptr;\
69 RACScreenPtr pScreenPriv = \
70 ((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr);\
71 PointPriv->spriteFuncs = pScreenPriv->miSprite;
72 #define SPRITE_EPILOG pScreenPriv->miSprite = PointPriv->spriteFuncs;\
73 PointPriv->spriteFuncs = &RACSpriteFuncs;
74 #define WRAP_SPRITE_COND(cond){pScreenPriv->miSprite = PointPriv->spriteFuncs;\
76 PointPriv->spriteFuncs = &RACSpriteFuncs;}
77 #define UNWRAP_SPRITE PointPriv->spriteFuncs = pScreenPriv->miSprite
80 #define GC_WRAP(x) pGCPriv->wrapOps = (x)->ops;\
81 pGCPriv->wrapFuncs = (x)->funcs;\
82 (x)->ops = &RACGCOps;\
83 (x)->funcs = &RACGCFuncs;
85 RACGCPtr pGCPriv = (RACGCPtr) (x)->devPrivates[RACGCIndex].ptr;\
86 (x)->ops = pGCPriv->wrapOps;\
87 (x)->funcs = pGCPriv->wrapFuncs;
89 #define GC_SCREEN register ScrnInfoPtr pScrn \
90 = xf86Screens[pGC->pScreen->myNum]
92 #define ENABLE xf86EnableAccess(xf86Screens[pScreen->myNum])
93 #define ENABLE_GC xf86EnableAccess(xf86Screens[pGC->pScreen->myNum])
95 typedef struct _RACScreen
{
96 CreateGCProcPtr CreateGC
;
97 CloseScreenProcPtr CloseScreen
;
98 GetImageProcPtr GetImage
;
99 GetSpansProcPtr GetSpans
;
100 SourceValidateProcPtr SourceValidate
;
101 PaintWindowBackgroundProcPtr PaintWindowBackground
;
102 PaintWindowBorderProcPtr PaintWindowBorder
;
103 CopyWindowProcPtr CopyWindow
;
104 ClearToBackgroundProcPtr ClearToBackground
;
105 BSFuncRec BackingStoreFuncs
;
106 CreatePixmapProcPtr CreatePixmap
;
107 SaveScreenProcPtr SaveScreen
;
109 StoreColorsProcPtr StoreColors
;
111 DisplayCursorProcPtr DisplayCursor
;
112 RealizeCursorProcPtr RealizeCursor
;
113 UnrealizeCursorProcPtr UnrealizeCursor
;
114 RecolorCursorProcPtr RecolorCursor
;
115 SetCursorPositionProcPtr SetCursorPosition
;
116 void (*AdjustFrame
)(int,int,int,int);
117 Bool (*SwitchMode
)(int, DisplayModePtr
,int);
118 Bool (*EnterVT
)(int, int);
119 void (*LeaveVT
)(int, int);
120 void (*FreeScreen
)(int, int);
121 miPointerSpriteFuncPtr miSprite
;
123 CompositeProcPtr Composite
;
124 GlyphsProcPtr Glyphs
;
125 CompositeRectsProcPtr CompositeRects
;
127 } RACScreenRec
, *RACScreenPtr
;
129 typedef struct _RACGC
{
132 } RACGCRec
, *RACGCPtr
;
135 static Bool
RACCloseScreen (int i
, ScreenPtr pScreen
);
136 static void RACGetImage (DrawablePtr pDrawable
, int sx
, int sy
,
137 int w
, int h
, unsigned int format
,
138 unsigned long planemask
, char *pdstLine
);
139 static void RACGetSpans (DrawablePtr pDrawable
, int wMax
, DDXPointPtr ppt
,
140 int *pwidth
, int nspans
, char *pdstStart
);
141 static void RACSourceValidate (DrawablePtr pDrawable
,
142 int x
, int y
, int width
, int height
);
143 static void RACPaintWindowBackground(WindowPtr pWin
, RegionPtr prgn
, int what
);
144 static void RACPaintWindowBorder(WindowPtr pWin
, RegionPtr prgn
, int what
);
145 static void RACCopyWindow(WindowPtr pWin
, DDXPointRec ptOldOrg
,
147 static void RACClearToBackground (WindowPtr pWin
, int x
, int y
,
148 int w
, int h
, Bool generateExposures
);
149 static void RACSaveAreas (PixmapPtr pPixmap
, RegionPtr prgnSave
,
150 int xorg
, int yorg
, WindowPtr pWin
);
151 static void RACRestoreAreas (PixmapPtr pPixmap
, RegionPtr prgnRestore
,
152 int xorg
, int yorg
, WindowPtr pWin
);
153 static PixmapPtr
RACCreatePixmap(ScreenPtr pScreen
, int w
, int h
, int depth
);
154 static Bool
RACCreateGC(GCPtr pGC
);
155 static Bool
RACSaveScreen(ScreenPtr pScreen
, Bool unblank
);
156 static void RACStoreColors (ColormapPtr pmap
, int ndef
, xColorItem
*pdefs
);
157 static void RACRecolorCursor (ScreenPtr pScreen
, CursorPtr pCurs
,
159 static Bool
RACRealizeCursor (ScreenPtr pScreen
, CursorPtr pCursor
);
160 static Bool
RACUnrealizeCursor (ScreenPtr pScreen
, CursorPtr pCursor
);
161 static Bool
RACDisplayCursor (ScreenPtr pScreen
, CursorPtr pCursor
);
162 static Bool
RACSetCursorPosition (ScreenPtr pScreen
, int x
, int y
,
164 static void RACAdjustFrame(int index
, int x
, int y
, int flags
);
165 static Bool
RACSwitchMode(int index
, DisplayModePtr mode
, int flags
);
166 static Bool
RACEnterVT(int index
, int flags
);
167 static void RACLeaveVT(int index
, int flags
);
168 static void RACFreeScreen(int index
, int flags
);
170 static void RACValidateGC(GCPtr pGC
, unsigned long changes
, DrawablePtr pDraw
);
171 static void RACChangeGC(GCPtr pGC
, unsigned long mask
);
172 static void RACCopyGC(GCPtr pGCSrc
, unsigned long mask
, GCPtr pGCDst
);
173 static void RACDestroyGC(GCPtr pGC
);
174 static void RACChangeClip(GCPtr pGC
, int type
, pointer pvalue
, int nrects
);
175 static void RACDestroyClip(GCPtr pGC
);
176 static void RACCopyClip(GCPtr pgcDst
, GCPtr pgcSrc
);
178 static void RACFillSpans( DrawablePtr pDraw
, GC
*pGC
, int nInit
,
179 DDXPointPtr pptInit
, int *pwidthInit
, int fSorted
);
180 static void RACSetSpans(DrawablePtr pDraw
, GCPtr pGC
, char *pcharsrc
,
181 register DDXPointPtr ppt
, int *pwidth
, int nspans
,
183 static void RACPutImage(DrawablePtr pDraw
, GCPtr pGC
, int depth
,
184 int x
, int y
, int w
, int h
, int leftPad
,
185 int format
, char *pImage
);
186 static RegionPtr
RACCopyArea(DrawablePtr pSrc
, DrawablePtr pDst
,
187 GC
*pGC
, int srcx
, int srcy
,
188 int width
, int height
,
189 int dstx
, int dsty
);
190 static RegionPtr
RACCopyPlane(DrawablePtr pSrc
, DrawablePtr pDst
,
191 GCPtr pGC
, int srcx
, int srcy
,
192 int width
, int height
, int dstx
, int dsty
,
193 unsigned long bitPlane
);
194 static void RACPolyPoint(DrawablePtr pDraw
, GCPtr pGC
, int mode
,
195 int npt
, xPoint
*pptInit
);
196 static void RACPolylines(DrawablePtr pDraw
, GCPtr pGC
, int mode
,
197 int npt
, DDXPointPtr pptInit
);
198 static void RACPolySegment(DrawablePtr pDraw
, GCPtr pGC
, int nseg
,
200 static void RACPolyRectangle(DrawablePtr pDraw
, GCPtr pGC
, int nRectsInit
,
201 xRectangle
*pRectsInit
);
202 static void RACPolyArc(DrawablePtr pDraw
, GCPtr pGC
, int narcs
,
204 static void RACFillPolygon(DrawablePtr pDraw
, GCPtr pGC
, int shape
, int mode
,
205 int count
, DDXPointPtr ptsIn
);
206 static void RACPolyFillRect( DrawablePtr pDraw
, GCPtr pGC
, int nrectFill
,
207 xRectangle
*prectInit
);
208 static void RACPolyFillArc(DrawablePtr pDraw
, GCPtr pGC
, int narcs
,
210 static int RACPolyText8(DrawablePtr pDraw
, GCPtr pGC
, int x
, int y
,
211 int count
, char *chars
);
212 static int RACPolyText16(DrawablePtr pDraw
, GCPtr pGC
, int x
, int y
,
213 int count
, unsigned short *chars
);
214 static void RACImageText8(DrawablePtr pDraw
, GCPtr pGC
, int x
, int y
,
215 int count
, char *chars
);
216 static void RACImageText16(DrawablePtr pDraw
, GCPtr pGC
, int x
, int y
,
217 int count
, unsigned short *chars
);
218 static void RACImageGlyphBlt(DrawablePtr pDraw
, GCPtr pGC
, int xInit
,
219 int yInit
, unsigned int nglyph
,
220 CharInfoPtr
*ppci
, pointer pglyphBase
);
221 static void RACPolyGlyphBlt(DrawablePtr pDraw
, GCPtr pGC
, int xInit
,
222 int yInit
, unsigned int nglyph
,
223 CharInfoPtr
*ppci
, pointer pglyphBase
);
224 static void RACPushPixels(GCPtr pGC
, PixmapPtr pBitMap
, DrawablePtr pDraw
,
225 int dx
, int dy
, int xOrg
, int yOrg
);
227 static Bool
RACSpriteRealizeCursor(ScreenPtr pScreen
, CursorPtr pCur
);
228 static Bool
RACSpriteUnrealizeCursor(ScreenPtr pScreen
, CursorPtr pCur
);
229 static void RACSpriteSetCursor(ScreenPtr pScreen
, CursorPtr pCur
,
231 static void RACSpriteMoveCursor(ScreenPtr pScreen
, int x
, int y
);
233 static void RACComposite(CARD8 op
, PicturePtr pSrc
, PicturePtr pMask
,
234 PicturePtr pDst
, INT16 xSrc
, INT16 ySrc
,
235 INT16 xMask
, INT16 yMask
, INT16 xDst
,
236 INT16 yDst
, CARD16 width
, CARD16 height
);
237 static void RACGlyphs(CARD8 op
, PicturePtr pSrc
, PicturePtr pDst
,
238 PictFormatPtr maskFormat
, INT16 xSrc
, INT16 ySrc
,
239 int nlist
, GlyphListPtr list
, GlyphPtr
*glyphs
);
240 static void RACCompositeRects(CARD8 op
, PicturePtr pDst
, xRenderColor
*color
,
241 int nRect
, xRectangle
*rects
);
244 static GCFuncs RACGCFuncs
= {
245 RACValidateGC
, RACChangeGC
, RACCopyGC
, RACDestroyGC
,
246 RACChangeClip
, RACDestroyClip
, RACCopyClip
249 static GCOps RACGCOps
= {
250 RACFillSpans
, RACSetSpans
, RACPutImage
, RACCopyArea
,
251 RACCopyPlane
, RACPolyPoint
, RACPolylines
, RACPolySegment
,
252 RACPolyRectangle
, RACPolyArc
, RACFillPolygon
, RACPolyFillRect
,
253 RACPolyFillArc
, RACPolyText8
, RACPolyText16
, RACImageText8
,
254 RACImageText16
, RACImageGlyphBlt
, RACPolyGlyphBlt
, RACPushPixels
,
255 {NULL
} /* devPrivate */
258 static miPointerSpriteFuncRec RACSpriteFuncs
= {
259 RACSpriteRealizeCursor
, RACSpriteUnrealizeCursor
, RACSpriteSetCursor
,
263 static int RACScreenIndex
= -1;
264 static int RACGCIndex
= -1;
265 static unsigned long RACGeneration
= 0;
269 xf86RACInit(ScreenPtr pScreen
, unsigned int flag
)
272 RACScreenPtr pScreenPriv
;
273 miPointerScreenPtr PointPriv
;
275 PictureScreenPtr ps
= GetPictureScreenIfSet(pScreen
);
278 pScrn
= xf86Screens
[pScreen
->myNum
];
279 PointPriv
= (miPointerScreenPtr
)pScreen
->devPrivates
[miPointerScreenIndex
].ptr
;
281 DPRINT_S("RACInit",pScreen
->myNum
);
282 if (RACGeneration
!= serverGeneration
) {
283 if ( ((RACScreenIndex
= AllocateScreenPrivateIndex()) < 0) ||
284 ((RACGCIndex
= AllocateGCPrivateIndex()) < 0))
287 RACGeneration
= serverGeneration
;
290 if (!AllocateGCPrivate(pScreen
, RACGCIndex
, sizeof(RACGCRec
)))
293 if (!(pScreenPriv
= xalloc(sizeof(RACScreenRec
))))
296 pScreen
->devPrivates
[RACScreenIndex
].ptr
= (pointer
)pScreenPriv
;
298 WRAP_SCREEN(CloseScreen
, RACCloseScreen
);
299 WRAP_SCREEN(SaveScreen
, RACSaveScreen
);
300 WRAP_SCREEN_COND(CreateGC
, RACCreateGC
, RAC_FB
);
301 WRAP_SCREEN_COND(GetImage
, RACGetImage
, RAC_FB
);
302 WRAP_SCREEN_COND(GetSpans
, RACGetSpans
, RAC_FB
);
303 WRAP_SCREEN_COND(SourceValidate
, RACSourceValidate
, RAC_FB
);
304 WRAP_SCREEN_COND(PaintWindowBackground
, RACPaintWindowBackground
, RAC_FB
);
305 WRAP_SCREEN_COND(PaintWindowBorder
, RACPaintWindowBorder
, RAC_FB
);
306 WRAP_SCREEN_COND(CopyWindow
, RACCopyWindow
, RAC_FB
);
307 WRAP_SCREEN_COND(ClearToBackground
, RACClearToBackground
, RAC_FB
);
308 WRAP_SCREEN_COND(CreatePixmap
, RACCreatePixmap
, RAC_FB
);
309 WRAP_SCREEN_COND(BackingStoreFuncs
.RestoreAreas
, RACRestoreAreas
, RAC_FB
);
310 WRAP_SCREEN_COND(BackingStoreFuncs
.SaveAreas
, RACSaveAreas
, RAC_FB
);
311 WRAP_SCREEN_COND(StoreColors
, RACStoreColors
, RAC_COLORMAP
);
312 WRAP_SCREEN_COND(DisplayCursor
, RACDisplayCursor
, RAC_CURSOR
);
313 WRAP_SCREEN_COND(RealizeCursor
, RACRealizeCursor
, RAC_CURSOR
);
314 WRAP_SCREEN_COND(UnrealizeCursor
, RACUnrealizeCursor
, RAC_CURSOR
);
315 WRAP_SCREEN_COND(RecolorCursor
, RACRecolorCursor
, RAC_CURSOR
);
316 WRAP_SCREEN_COND(SetCursorPosition
, RACSetCursorPosition
, RAC_CURSOR
);
318 WRAP_PICT_COND(Composite
,RACComposite
,RAC_FB
);
319 WRAP_PICT_COND(Glyphs
,RACGlyphs
,RAC_FB
);
320 WRAP_PICT_COND(CompositeRects
,RACCompositeRects
,RAC_FB
);
322 WRAP_SCREEN_INFO_COND(AdjustFrame
, RACAdjustFrame
, RAC_VIEWPORT
);
323 WRAP_SCREEN_INFO(SwitchMode
, RACSwitchMode
);
324 WRAP_SCREEN_INFO(EnterVT
, RACEnterVT
);
325 WRAP_SCREEN_INFO(LeaveVT
, RACLeaveVT
);
326 WRAP_SCREEN_INFO(FreeScreen
, RACFreeScreen
);
327 WRAP_SPRITE_COND(RAC_CURSOR
);
334 RACCloseScreen (int i
, ScreenPtr pScreen
)
336 ScrnInfoPtr pScrn
= xf86Screens
[pScreen
->myNum
];
337 RACScreenPtr pScreenPriv
=
338 (RACScreenPtr
) pScreen
->devPrivates
[RACScreenIndex
].ptr
;
339 miPointerScreenPtr PointPriv
340 = (miPointerScreenPtr
)pScreen
->devPrivates
[miPointerScreenIndex
].ptr
;
342 PictureScreenPtr ps
= GetPictureScreenIfSet(pScreen
);
345 DPRINT_S("RACCloseScreen",pScreen
->myNum
);
346 UNWRAP_SCREEN(CreateGC
);
347 UNWRAP_SCREEN(CloseScreen
);
348 UNWRAP_SCREEN(GetImage
);
349 UNWRAP_SCREEN(GetSpans
);
350 UNWRAP_SCREEN(SourceValidate
);
351 UNWRAP_SCREEN(PaintWindowBackground
);
352 UNWRAP_SCREEN(PaintWindowBorder
);
353 UNWRAP_SCREEN(CopyWindow
);
354 UNWRAP_SCREEN(ClearToBackground
);
355 UNWRAP_SCREEN(BackingStoreFuncs
.RestoreAreas
);
356 UNWRAP_SCREEN(BackingStoreFuncs
.SaveAreas
);
357 UNWRAP_SCREEN(SaveScreen
);
358 UNWRAP_SCREEN(StoreColors
);
359 UNWRAP_SCREEN(DisplayCursor
);
360 UNWRAP_SCREEN(RealizeCursor
);
361 UNWRAP_SCREEN(UnrealizeCursor
);
362 UNWRAP_SCREEN(RecolorCursor
);
363 UNWRAP_SCREEN(SetCursorPosition
);
365 UNWRAP_PICT(Composite
);
367 UNWRAP_PICT(CompositeRects
);
369 UNWRAP_SCREEN_INFO(AdjustFrame
);
370 UNWRAP_SCREEN_INFO(SwitchMode
);
371 UNWRAP_SCREEN_INFO(EnterVT
);
372 UNWRAP_SCREEN_INFO(LeaveVT
);
373 UNWRAP_SCREEN_INFO(FreeScreen
);
376 xfree ((pointer
) pScreenPriv
);
378 if (xf86Screens
[pScreen
->myNum
]->vtSema
) {
379 xf86EnterServerState(SETUP
);
382 return (*pScreen
->CloseScreen
) (i
, pScreen
);
387 DrawablePtr pDrawable
,
388 int sx
, int sy
, int w
, int h
,
390 unsigned long planemask
,
394 ScreenPtr pScreen
= pDrawable
->pScreen
;
395 DPRINT_S("RACGetImage",pScreen
->myNum
);
396 SCREEN_PROLOG(GetImage
);
397 if (xf86Screens
[pScreen
->myNum
]->vtSema
) {
400 (*pScreen
->GetImage
) (pDrawable
, sx
, sy
, w
, h
,
401 format
, planemask
, pdstLine
);
402 SCREEN_EPILOG (GetImage
, RACGetImage
);
407 DrawablePtr pDrawable
,
415 ScreenPtr pScreen
= pDrawable
->pScreen
;
417 DPRINT_S("RACGetSpans",pScreen
->myNum
);
418 SCREEN_PROLOG (GetSpans
);
420 (*pScreen
->GetSpans
) (pDrawable
, wMax
, ppt
, pwidth
, nspans
, pdstStart
);
421 SCREEN_EPILOG (GetSpans
, RACGetSpans
);
426 DrawablePtr pDrawable
,
427 int x
, int y
, int width
, int height
)
429 ScreenPtr pScreen
= pDrawable
->pScreen
;
430 DPRINT_S("RACSourceValidate",pScreen
->myNum
);
431 SCREEN_PROLOG (SourceValidate
);
433 if (pScreen
->SourceValidate
)
434 (*pScreen
->SourceValidate
) (pDrawable
, x
, y
, width
, height
);
435 SCREEN_EPILOG (SourceValidate
, RACSourceValidate
);
439 RACPaintWindowBackground(
445 ScreenPtr pScreen
= pWin
->drawable
.pScreen
;
447 DPRINT_S("RACPaintWindowBackground",pScreen
->myNum
);
448 SCREEN_PROLOG (PaintWindowBackground
);
450 (*pScreen
->PaintWindowBackground
) (pWin
, prgn
, what
);
451 SCREEN_EPILOG (PaintWindowBackground
, RACPaintWindowBackground
);
455 RACPaintWindowBorder(
461 ScreenPtr pScreen
= pWin
->drawable
.pScreen
;
463 DPRINT_S("RACPaintWindowBorder",pScreen
->myNum
);
464 SCREEN_PROLOG (PaintWindowBorder
);
466 (*pScreen
->PaintWindowBorder
) (pWin
, prgn
, what
);
467 SCREEN_EPILOG (PaintWindowBorder
, RACPaintWindowBorder
);
473 DDXPointRec ptOldOrg
,
476 ScreenPtr pScreen
= pWin
->drawable
.pScreen
;
478 DPRINT_S("RACCopyWindow",pScreen
->myNum
);
479 SCREEN_PROLOG (CopyWindow
);
481 (*pScreen
->CopyWindow
) (pWin
, ptOldOrg
, prgnSrc
);
482 SCREEN_EPILOG (CopyWindow
, RACCopyWindow
);
486 RACClearToBackground (
490 Bool generateExposures
)
492 ScreenPtr pScreen
= pWin
->drawable
.pScreen
;
494 DPRINT_S("RACClearToBackground",pScreen
->myNum
);
495 SCREEN_PROLOG ( ClearToBackground
);
497 (*pScreen
->ClearToBackground
) (pWin
, x
, y
, w
, h
, generateExposures
);
498 SCREEN_EPILOG (ClearToBackground
, RACClearToBackground
);
510 ScreenPtr pScreen
= pPixmap
->drawable
.pScreen
;
511 DPRINT_S("RACSaveAreas",pScreen
->myNum
);
512 SCREEN_PROLOG (BackingStoreFuncs
.SaveAreas
);
514 (*pScreen
->BackingStoreFuncs
.SaveAreas
) (
515 pPixmap
, prgnSave
, xorg
, yorg
, pWin
);
517 SCREEN_EPILOG (BackingStoreFuncs
.SaveAreas
, RACSaveAreas
);
523 RegionPtr prgnRestore
,
529 ScreenPtr pScreen
= pPixmap
->drawable
.pScreen
;
531 DPRINT_S("RACRestoreAreas",pScreen
->myNum
);
532 SCREEN_PROLOG (BackingStoreFuncs
.RestoreAreas
);
534 (*pScreen
->BackingStoreFuncs
.RestoreAreas
) (
535 pPixmap
, prgnRestore
, xorg
, yorg
, pWin
);
537 SCREEN_EPILOG ( BackingStoreFuncs
.RestoreAreas
, RACRestoreAreas
);
541 RACCreatePixmap(ScreenPtr pScreen
, int w
, int h
, int depth
)
545 DPRINT_S("RACCreatePixmap",pScreen
->myNum
);
546 SCREEN_PROLOG ( CreatePixmap
);
548 pPix
= (*pScreen
->CreatePixmap
) (pScreen
, w
, h
, depth
);
549 SCREEN_EPILOG (CreatePixmap
, RACCreatePixmap
);
555 RACSaveScreen(ScreenPtr pScreen
, Bool unblank
)
559 DPRINT_S("RACSaveScreen",pScreen
->myNum
);
560 SCREEN_PROLOG (SaveScreen
);
562 val
= (*pScreen
->SaveScreen
) (pScreen
, unblank
);
563 SCREEN_EPILOG (SaveScreen
, RACSaveScreen
);
574 ScreenPtr pScreen
= pmap
->pScreen
;
576 DPRINT_S("RACStoreColors",pScreen
->myNum
);
577 SCREEN_PROLOG (StoreColors
);
579 (*pScreen
->StoreColors
) (pmap
,ndef
,pdefs
);
581 SCREEN_EPILOG ( StoreColors
, RACStoreColors
);
591 DPRINT_S("RACRecolorCursor",pScreen
->myNum
);
592 SCREEN_PROLOG (RecolorCursor
);
594 (*pScreen
->RecolorCursor
) (pScreen
,pCurs
,displayed
);
596 SCREEN_EPILOG ( RecolorCursor
, RACRecolorCursor
);
607 DPRINT_S("RACRealizeCursor",pScreen
->myNum
);
608 SCREEN_PROLOG (RealizeCursor
);
610 val
= (*pScreen
->RealizeCursor
) (pScreen
,pCursor
);
612 SCREEN_EPILOG ( RealizeCursor
, RACRealizeCursor
);
624 DPRINT_S("RACUnrealizeCursor",pScreen
->myNum
);
625 SCREEN_PROLOG (UnrealizeCursor
);
627 val
= (*pScreen
->UnrealizeCursor
) (pScreen
,pCursor
);
629 SCREEN_EPILOG ( UnrealizeCursor
, RACUnrealizeCursor
);
641 DPRINT_S("RACDisplayCursor",pScreen
->myNum
);
642 SCREEN_PROLOG (DisplayCursor
);
644 val
= (*pScreen
->DisplayCursor
) (pScreen
,pCursor
);
646 SCREEN_EPILOG ( DisplayCursor
, RACDisplayCursor
);
651 RACSetCursorPosition (
658 DPRINT_S("RACSetCursorPosition",pScreen
->myNum
);
659 SCREEN_PROLOG (SetCursorPosition
);
661 val
= (*pScreen
->SetCursorPosition
) (pScreen
,x
,y
,generateEvent
);
663 SCREEN_EPILOG ( SetCursorPosition
, RACSetCursorPosition
);
668 RACAdjustFrame(int index
, int x
, int y
, int flags
)
670 ScreenPtr pScreen
= screenInfo
.screens
[index
];
671 RACScreenPtr pScreenPriv
=
672 (RACScreenPtr
) pScreen
->devPrivates
[RACScreenIndex
].ptr
;
674 DPRINT_S("RACAdjustFrame",index
);
675 xf86EnableAccess(xf86Screens
[index
]);
677 (*pScreenPriv
->AdjustFrame
)(index
, x
, y
, flags
);
681 RACSwitchMode(int index
, DisplayModePtr mode
, int flags
)
683 ScreenPtr pScreen
= screenInfo
.screens
[index
];
684 RACScreenPtr pScreenPriv
=
685 (RACScreenPtr
) pScreen
->devPrivates
[RACScreenIndex
].ptr
;
687 DPRINT_S("RACSwitchMode",index
);
688 xf86EnableAccess(xf86Screens
[index
]);
690 return (*pScreenPriv
->SwitchMode
)(index
, mode
, flags
);
694 RACEnterVT(int index
, int flags
)
696 ScreenPtr pScreen
= screenInfo
.screens
[index
];
697 RACScreenPtr pScreenPriv
=
698 (RACScreenPtr
) pScreen
->devPrivates
[RACScreenIndex
].ptr
;
700 DPRINT_S("RACEnterVT",index
);
701 xf86EnableAccess(xf86Screens
[index
]);
703 return (*pScreenPriv
->EnterVT
)(index
, flags
);
707 RACLeaveVT(int index
, int flags
)
709 ScreenPtr pScreen
= screenInfo
.screens
[index
];
710 RACScreenPtr pScreenPriv
=
711 (RACScreenPtr
) pScreen
->devPrivates
[RACScreenIndex
].ptr
;
713 DPRINT_S("RACLeaveVT",index
);
714 xf86EnableAccess(xf86Screens
[index
]);
716 (*pScreenPriv
->LeaveVT
)(index
, flags
);
720 RACFreeScreen(int index
, int flags
)
722 ScreenPtr pScreen
= screenInfo
.screens
[index
];
723 RACScreenPtr pScreenPriv
=
724 (RACScreenPtr
) pScreen
->devPrivates
[RACScreenIndex
].ptr
;
726 DPRINT_S("RACFreeScreen",index
);
727 xf86EnableAccess(xf86Screens
[index
]);
729 (*pScreenPriv
->FreeScreen
)(index
, flags
);
733 RACCreateGC(GCPtr pGC
)
735 ScreenPtr pScreen
= pGC
->pScreen
;
736 RACGCPtr pGCPriv
= (RACGCPtr
) (pGC
)->devPrivates
[RACGCIndex
].ptr
;
739 DPRINT_S("RACCreateGC",pScreen
->myNum
);
740 SCREEN_PROLOG(CreateGC
);
742 ret
= (*pScreen
->CreateGC
)(pGC
);
745 SCREEN_EPILOG(CreateGC
,RACCreateGC
);
754 unsigned long changes
,
758 DPRINT("RACValidateGC");
759 (*pGC
->funcs
->ValidateGC
)(pGC
, changes
, pDraw
);
765 RACDestroyGC(GCPtr pGC
)
768 DPRINT("RACDestroyGC");
769 (*pGC
->funcs
->DestroyGC
)(pGC
);
779 DPRINT("RACChangeGC");
780 (*pGC
->funcs
->ChangeGC
) (pGC
, mask
);
792 (*pGCDst
->funcs
->CopyGC
) (pGCSrc
, mask
, pGCDst
);
804 DPRINT("RACChangeClip");
805 (*pGC
->funcs
->ChangeClip
) (pGC
, type
, pvalue
, nrects
);
810 RACCopyClip(GCPtr pgcDst
, GCPtr pgcSrc
)
813 DPRINT("RACCopyClip");
814 (* pgcDst
->funcs
->CopyClip
)(pgcDst
, pgcSrc
);
819 RACDestroyClip(GCPtr pGC
)
822 DPRINT("RACDestroyClip");
823 (* pGC
->funcs
->DestroyClip
)(pGC
);
838 DPRINT("RACFillSpans");
840 (*pGC
->ops
->FillSpans
)(pDraw
, pGC
, nInit
, pptInit
, pwidthInit
, fSorted
);
849 register DDXPointPtr ppt
,
855 DPRINT("RACSetSpans");
857 (*pGC
->ops
->SetSpans
)(pDraw
, pGC
, pcharsrc
, ppt
, pwidth
, nspans
, fSorted
);
866 int x
, int y
, int w
, int h
,
872 DPRINT("RACPutImage");
874 (*pGC
->ops
->PutImage
)(pDraw
, pGC
, depth
, x
, y
, w
, h
,
875 leftPad
, format
, pImage
);
885 int width
, int height
,
891 DPRINT("RACCopyArea");
893 ret
= (*pGC
->ops
->CopyArea
)(pSrc
, pDst
,
894 pGC
, srcx
, srcy
, width
, height
, dstx
, dsty
);
905 int width
, int height
,
907 unsigned long bitPlane
)
912 DPRINT("RACCopyPlane");
914 ret
= (*pGC
->ops
->CopyPlane
)(pSrc
, pDst
, pGC
, srcx
, srcy
,
915 width
, height
, dstx
, dsty
, bitPlane
);
929 DPRINT("RACPolyPoint");
931 (*pGC
->ops
->PolyPoint
)(pDraw
, pGC
, mode
, npt
, pptInit
);
942 DDXPointPtr pptInit
)
945 DPRINT("RACPolylines");
947 (*pGC
->ops
->Polylines
)(pDraw
, pGC
, mode
, npt
, pptInit
);
959 DPRINT("RACPolySegment");
961 (*pGC
->ops
->PolySegment
)(pDraw
, pGC
, nseg
, pSeg
);
970 xRectangle
*pRectsInit
)
973 DPRINT("RACPolyRectangle");
975 (*pGC
->ops
->PolyRectangle
)(pDraw
, pGC
, nRectsInit
, pRectsInit
);
987 DPRINT("RACPolyArc");
989 (*pGC
->ops
->PolyArc
)(pDraw
, pGC
, narcs
, parcs
);
1003 DPRINT("RACFillPolygon");
1005 (*pGC
->ops
->FillPolygon
)(pDraw
, pGC
, shape
, mode
, count
, ptsIn
);
1015 xRectangle
*prectInit
)
1018 DPRINT("RACPolyFillRect");
1020 (*pGC
->ops
->PolyFillRect
)(pDraw
, pGC
, nrectFill
, prectInit
);
1033 DPRINT("RACPolyFillArc");
1035 (*pGC
->ops
->PolyFillArc
)(pDraw
, pGC
, narcs
, parcs
);
1051 DPRINT("RACPolyText8");
1053 ret
= (*pGC
->ops
->PolyText8
)(pDraw
, pGC
, x
, y
, count
, chars
);
1065 unsigned short *chars
)
1070 DPRINT("RACPolyText16");
1072 ret
= (*pGC
->ops
->PolyText16
)(pDraw
, pGC
, x
, y
, count
, chars
);
1087 DPRINT("RACImageText8");
1089 (*pGC
->ops
->ImageText8
)(pDraw
, pGC
, x
, y
, count
, chars
);
1100 unsigned short *chars
)
1103 DPRINT("RACImageText16");
1105 (*pGC
->ops
->ImageText16
)(pDraw
, pGC
, x
, y
, count
, chars
);
1114 int xInit
, int yInit
,
1115 unsigned int nglyph
,
1117 pointer pglyphBase
)
1120 DPRINT("RACImageGlyphBlt");
1122 (*pGC
->ops
->ImageGlyphBlt
)(pDraw
, pGC
, xInit
, yInit
,
1123 nglyph
, ppci
, pglyphBase
);
1131 int xInit
, int yInit
,
1132 unsigned int nglyph
,
1134 pointer pglyphBase
)
1137 DPRINT("RACPolyGlyphBlt");
1139 (*pGC
->ops
->PolyGlyphBlt
)(pDraw
, pGC
, xInit
, yInit
,
1140 nglyph
, ppci
, pglyphBase
);
1149 int dx
, int dy
, int xOrg
, int yOrg
)
1152 DPRINT("RACPushPixels");
1154 (*pGC
->ops
->PushPixels
)(pGC
, pBitMap
, pDraw
, dx
, dy
, xOrg
, yOrg
);
1161 RACSpriteRealizeCursor(ScreenPtr pScreen
, CursorPtr pCur
)
1165 DPRINT_S("RACSpriteRealizeCursor",pScreen
->myNum
);
1167 val
= PointPriv
->spriteFuncs
->RealizeCursor(pScreen
, pCur
);
1173 RACSpriteUnrealizeCursor(ScreenPtr pScreen
, CursorPtr pCur
)
1177 DPRINT_S("RACSpriteUnrealizeCursor",pScreen
->myNum
);
1179 val
= PointPriv
->spriteFuncs
->UnrealizeCursor(pScreen
, pCur
);
1185 RACSpriteSetCursor(ScreenPtr pScreen
, CursorPtr pCur
, int x
, int y
)
1188 DPRINT_S("RACSpriteSetCursor",pScreen
->myNum
);
1190 PointPriv
->spriteFuncs
->SetCursor(pScreen
, pCur
, x
, y
);
1195 RACSpriteMoveCursor(ScreenPtr pScreen
, int x
, int y
)
1198 DPRINT_S("RACSpriteMoveCursor",pScreen
->myNum
);
1200 PointPriv
->spriteFuncs
->MoveCursor(pScreen
, x
, y
);
1206 RACComposite(CARD8 op
, PicturePtr pSrc
, PicturePtr pMask
,
1207 PicturePtr pDst
, INT16 xSrc
, INT16 ySrc
, INT16 xMask
,
1208 INT16 yMask
, INT16 xDst
, INT16 yDst
, CARD16 width
,
1211 ScreenPtr pScreen
= pDst
->pDrawable
->pScreen
;
1212 PictureScreenPtr ps
= GetPictureScreen(pScreen
);
1214 PICTURE_PROLOGUE(Composite
);
1217 (*ps
->Composite
) (op
, pSrc
, pMask
, pDst
, xSrc
, ySrc
, xMask
, yMask
, xDst
,
1218 yDst
, width
, height
);
1220 PICTURE_EPILOGUE(Composite
, RACComposite
);
1224 RACGlyphs(CARD8 op
, PicturePtr pSrc
, PicturePtr pDst
,
1225 PictFormatPtr maskFormat
, INT16 xSrc
, INT16 ySrc
, int nlist
,
1226 GlyphListPtr list
, GlyphPtr
*glyphs
)
1228 ScreenPtr pScreen
= pDst
->pDrawable
->pScreen
;
1229 PictureScreenPtr ps
= GetPictureScreen(pScreen
);
1231 PICTURE_PROLOGUE(Glyphs
);
1234 (*ps
->Glyphs
)(op
, pSrc
, pDst
, maskFormat
, xSrc
, ySrc
, nlist
, list
, glyphs
);
1236 PICTURE_EPILOGUE (Glyphs
, RACGlyphs
);
1240 RACCompositeRects(CARD8 op
, PicturePtr pDst
, xRenderColor
*color
, int nRect
,
1243 ScreenPtr pScreen
= pDst
->pDrawable
->pScreen
;
1244 PictureScreenPtr ps
= GetPictureScreen(pScreen
);
1246 PICTURE_PROLOGUE(CompositeRects
);
1249 (*ps
->CompositeRects
)(op
, pDst
, color
, nRect
, rects
);
1251 PICTURE_EPILOGUE (CompositeRects
, RACCompositeRects
);