1
/* $XFree86: xc/programs/Xserver/hw/xfree86/rac/xf86RAC.c,v 1.7 2002/09/16 18:06:18 eich Exp $ */
5
#include "xf86_ansic.h"
6
#include "xf86_OSproc.h"
9
#include "colormapst.h"
10
#include "scrnintstr.h"
11
#include "screenint.h"
13
#include "pixmapstr.h"
15
#include "windowstr.h"
19
#include "mipointer.h"
20
#include "mipointrst.h"
22
# include "picturestr.h"
26
#define DPRINT_S(x,y) ErrorF(x ": %i\n",y);
27
#define DPRINT(x) ErrorF(x "\n");
33
#define WRAP_SCREEN(x,y) {pScreenPriv->x = pScreen->x;\
35
#define WRAP_SCREEN_COND(x,y,cond) \
36
{pScreenPriv->x = pScreen->x;\
39
#define UNWRAP_SCREEN(x) pScreen->x = pScreenPriv->x
41
#define SCREEN_PROLOG(x) \
43
((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr)->x
44
#define SCREEN_EPILOG(x,y) pScreen->x = y;
46
#define WRAP_PICT_COND(x,y,cond) if (ps)\
47
{pScreenPriv->x = ps->x;\
50
#define UNWRAP_PICT(x) if (ps) {ps->x = pScreenPriv->x;}
52
#define PICTURE_PROLOGUE(field) \
54
((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr)->field
55
#define PICTURE_EPILOGUE(field, wrap) \
58
#define WRAP_SCREEN_INFO(x,y) {pScreenPriv->x = pScrn->x;\
60
#define WRAP_SCREEN_INFO_COND(x,y,cond) \
61
{pScreenPriv->x = pScrn->x;\
64
#define UNWRAP_SCREEN_INFO(x) pScrn->x = pScreenPriv->x
66
#define SPRITE_PROLOG miPointerScreenPtr PointPriv = \
67
(miPointerScreenPtr)pScreen->devPrivates[miPointerScreenIndex].ptr;\
68
RACScreenPtr pScreenPriv = \
69
((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr);\
70
PointPriv->spriteFuncs = pScreenPriv->miSprite;
71
#define SPRITE_EPILOG pScreenPriv->miSprite = PointPriv->spriteFuncs;\
72
PointPriv->spriteFuncs = &RACSpriteFuncs;
73
#define WRAP_SPRITE_COND(cond){pScreenPriv->miSprite = PointPriv->spriteFuncs;\
75
PointPriv->spriteFuncs = &RACSpriteFuncs;}
76
#define UNWRAP_SPRITE PointPriv->spriteFuncs = pScreenPriv->miSprite
79
#define GC_WRAP(x) pGCPriv->wrapOps = (x)->ops;\
80
pGCPriv->wrapFuncs = (x)->funcs;\
81
(x)->ops = &RACGCOps;\
82
(x)->funcs = &RACGCFuncs;
84
RACGCPtr pGCPriv = (RACGCPtr) (x)->devPrivates[RACGCIndex].ptr;\
85
(x)->ops = pGCPriv->wrapOps;\
86
(x)->funcs = pGCPriv->wrapFuncs;
88
#define GC_SCREEN register ScrnInfoPtr pScrn \
89
= xf86Screens[pGC->pScreen->myNum]
91
#define ENABLE xf86EnableAccess(xf86Screens[pScreen->myNum])
92
#define ENABLE_GC xf86EnableAccess(xf86Screens[pGC->pScreen->myNum])
94
typedef struct _RACScreen {
95
CreateGCProcPtr CreateGC;
96
CloseScreenProcPtr CloseScreen;
97
GetImageProcPtr GetImage;
98
GetSpansProcPtr GetSpans;
99
SourceValidateProcPtr SourceValidate;
100
PaintWindowBackgroundProcPtr PaintWindowBackground;
101
PaintWindowBorderProcPtr PaintWindowBorder;
102
CopyWindowProcPtr CopyWindow;
103
ClearToBackgroundProcPtr ClearToBackground;
104
BSFuncRec BackingStoreFuncs;
105
CreatePixmapProcPtr CreatePixmap;
106
SaveScreenProcPtr SaveScreen;
108
StoreColorsProcPtr StoreColors;
110
DisplayCursorProcPtr DisplayCursor;
111
RealizeCursorProcPtr RealizeCursor;
112
UnrealizeCursorProcPtr UnrealizeCursor;
113
RecolorCursorProcPtr RecolorCursor;
114
SetCursorPositionProcPtr SetCursorPosition;
115
void (*AdjustFrame)(int,int,int,int);
116
Bool (*SwitchMode)(int, DisplayModePtr,int);
117
Bool (*EnterVT)(int, int);
118
void (*LeaveVT)(int, int);
119
void (*FreeScreen)(int, int);
120
miPointerSpriteFuncPtr miSprite;
122
CompositeProcPtr Composite;
123
GlyphsProcPtr Glyphs;
124
CompositeRectsProcPtr CompositeRects;
126
} RACScreenRec, *RACScreenPtr;
128
typedef struct _RACGC {
131
} RACGCRec, *RACGCPtr;
134
static Bool RACCloseScreen (int i, ScreenPtr pScreen);
135
static void RACGetImage (DrawablePtr pDrawable, int sx, int sy,
136
int w, int h, unsigned int format,
137
unsigned long planemask, char *pdstLine);
138
static void RACGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
139
int *pwidth, int nspans, char *pdstStart);
140
static void RACSourceValidate (DrawablePtr pDrawable,
141
int x, int y, int width, int height );
142
static void RACPaintWindowBackground(WindowPtr pWin, RegionPtr prgn, int what);
143
static void RACPaintWindowBorder(WindowPtr pWin, RegionPtr prgn, int what);
144
static void RACCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
146
static void RACClearToBackground (WindowPtr pWin, int x, int y,
147
int w, int h, Bool generateExposures );
148
static void RACSaveAreas (PixmapPtr pPixmap, RegionPtr prgnSave,
149
int xorg, int yorg, WindowPtr pWin);
150
static void RACRestoreAreas (PixmapPtr pPixmap, RegionPtr prgnRestore,
151
int xorg, int yorg, WindowPtr pWin);
152
static PixmapPtr RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth);
153
static Bool RACCreateGC(GCPtr pGC);
154
static Bool RACSaveScreen(ScreenPtr pScreen, Bool unblank);
155
static void RACStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs);
156
static void RACRecolorCursor (ScreenPtr pScreen, CursorPtr pCurs,
158
static Bool RACRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor);
159
static Bool RACUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor);
160
static Bool RACDisplayCursor (ScreenPtr pScreen, CursorPtr pCursor);
161
static Bool RACSetCursorPosition (ScreenPtr pScreen, int x, int y,
163
static void RACAdjustFrame(int index, int x, int y, int flags);
164
static Bool RACSwitchMode(int index, DisplayModePtr mode, int flags);
165
static Bool RACEnterVT(int index, int flags);
166
static void RACLeaveVT(int index, int flags);
167
static void RACFreeScreen(int index, int flags);
169
static void RACValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
170
static void RACChangeGC(GCPtr pGC, unsigned long mask);
171
static void RACCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
172
static void RACDestroyGC(GCPtr pGC);
173
static void RACChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
174
static void RACDestroyClip(GCPtr pGC);
175
static void RACCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
177
static void RACFillSpans( DrawablePtr pDraw, GC *pGC, int nInit,
178
DDXPointPtr pptInit, int *pwidthInit, int fSorted );
179
static void RACSetSpans(DrawablePtr pDraw, GCPtr pGC, char *pcharsrc,
180
register DDXPointPtr ppt, int *pwidth, int nspans,
182
static void RACPutImage(DrawablePtr pDraw, GCPtr pGC, int depth,
183
int x, int y, int w, int h, int leftPad,
184
int format, char *pImage );
185
static RegionPtr RACCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
186
GC *pGC, int srcx, int srcy,
187
int width, int height,
188
int dstx, int dsty );
189
static RegionPtr RACCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
190
GCPtr pGC, int srcx, int srcy,
191
int width, int height, int dstx, int dsty,
192
unsigned long bitPlane );
193
static void RACPolyPoint(DrawablePtr pDraw, GCPtr pGC, int mode,
194
int npt, xPoint *pptInit );
195
static void RACPolylines(DrawablePtr pDraw, GCPtr pGC, int mode,
196
int npt, DDXPointPtr pptInit );
197
static void RACPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg,
199
static void RACPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nRectsInit,
200
xRectangle *pRectsInit );
201
static void RACPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
203
static void RACFillPolygon(DrawablePtr pDraw, GCPtr pGC, int shape, int mode,
204
int count, DDXPointPtr ptsIn );
205
static void RACPolyFillRect( DrawablePtr pDraw, GCPtr pGC, int nrectFill,
206
xRectangle *prectInit );
207
static void RACPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
209
static int RACPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y,
210
int count, char *chars );
211
static int RACPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y,
212
int count, unsigned short *chars );
213
static void RACImageText8(DrawablePtr pDraw, GCPtr pGC, int x, int y,
214
int count, char *chars );
215
static void RACImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y,
216
int count, unsigned short *chars );
217
static void RACImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit,
218
int yInit, unsigned int nglyph,
219
CharInfoPtr *ppci, pointer pglyphBase );
220
static void RACPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit,
221
int yInit, unsigned int nglyph,
222
CharInfoPtr *ppci, pointer pglyphBase );
223
static void RACPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDraw,
224
int dx, int dy, int xOrg, int yOrg );
226
static Bool RACSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCur);
227
static Bool RACSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCur);
228
static void RACSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCur,
230
static void RACSpriteMoveCursor(ScreenPtr pScreen, int x, int y);
232
static void RACComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
233
PicturePtr pDst, INT16 xSrc, INT16 ySrc,
234
INT16 xMask, INT16 yMask, INT16 xDst,
235
INT16 yDst, CARD16 width, CARD16 height);
236
static void RACGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
237
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
238
int nlist, GlyphListPtr list, GlyphPtr *glyphs);
239
static void RACCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color,
240
int nRect, xRectangle *rects);
243
GCFuncs RACGCFuncs = {
244
RACValidateGC, RACChangeGC, RACCopyGC, RACDestroyGC,
245
RACChangeClip, RACDestroyClip, RACCopyClip
249
RACFillSpans, RACSetSpans, RACPutImage, RACCopyArea,
250
RACCopyPlane, RACPolyPoint, RACPolylines, RACPolySegment,
251
RACPolyRectangle, RACPolyArc, RACFillPolygon, RACPolyFillRect,
252
RACPolyFillArc, RACPolyText8, RACPolyText16, RACImageText8,
253
RACImageText16, RACImageGlyphBlt, RACPolyGlyphBlt, RACPushPixels,
254
#ifdef NEED_LINEHELPER
257
{NULL} /* devPrivate */
260
miPointerSpriteFuncRec RACSpriteFuncs = {
261
RACSpriteRealizeCursor, RACSpriteUnrealizeCursor, RACSpriteSetCursor,
265
int RACScreenIndex = -1;
267
static unsigned long RACGeneration = 0;
271
xf86RACInit(ScreenPtr pScreen, unsigned int flag)
274
RACScreenPtr pScreenPriv;
275
miPointerScreenPtr PointPriv;
277
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
280
pScrn = xf86Screens[pScreen->myNum];
281
PointPriv = (miPointerScreenPtr)pScreen->devPrivates[miPointerScreenIndex].ptr;
283
DPRINT_S("RACInit",pScreen->myNum);
284
if (RACGeneration != serverGeneration) {
285
if ( ((RACScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
286
((RACGCIndex = AllocateGCPrivateIndex()) < 0))
289
RACGeneration = serverGeneration;
292
if (!AllocateGCPrivate(pScreen, RACGCIndex, sizeof(RACGCRec)))
295
if (!(pScreenPriv = xalloc(sizeof(RACScreenRec))))
298
pScreen->devPrivates[RACScreenIndex].ptr = (pointer)pScreenPriv;
300
WRAP_SCREEN(CloseScreen, RACCloseScreen);
301
WRAP_SCREEN(SaveScreen, RACSaveScreen);
302
WRAP_SCREEN_COND(CreateGC, RACCreateGC, RAC_FB);
303
WRAP_SCREEN_COND(GetImage, RACGetImage, RAC_FB);
304
WRAP_SCREEN_COND(GetSpans, RACGetSpans, RAC_FB);
305
WRAP_SCREEN_COND(SourceValidate, RACSourceValidate, RAC_FB);
306
WRAP_SCREEN_COND(PaintWindowBackground, RACPaintWindowBackground, RAC_FB);
307
WRAP_SCREEN_COND(PaintWindowBorder, RACPaintWindowBorder, RAC_FB);
308
WRAP_SCREEN_COND(CopyWindow, RACCopyWindow, RAC_FB);
309
WRAP_SCREEN_COND(ClearToBackground, RACClearToBackground, RAC_FB);
310
WRAP_SCREEN_COND(CreatePixmap, RACCreatePixmap, RAC_FB);
311
WRAP_SCREEN_COND(BackingStoreFuncs.RestoreAreas, RACRestoreAreas, RAC_FB);
312
WRAP_SCREEN_COND(BackingStoreFuncs.SaveAreas, RACSaveAreas, RAC_FB);
313
WRAP_SCREEN_COND(StoreColors, RACStoreColors, RAC_COLORMAP);
314
WRAP_SCREEN_COND(DisplayCursor, RACDisplayCursor, RAC_CURSOR);
315
WRAP_SCREEN_COND(RealizeCursor, RACRealizeCursor, RAC_CURSOR);
316
WRAP_SCREEN_COND(UnrealizeCursor, RACUnrealizeCursor, RAC_CURSOR);
317
WRAP_SCREEN_COND(RecolorCursor, RACRecolorCursor, RAC_CURSOR);
318
WRAP_SCREEN_COND(SetCursorPosition, RACSetCursorPosition, RAC_CURSOR);
320
WRAP_PICT_COND(Composite,RACComposite,RAC_FB);
321
WRAP_PICT_COND(Glyphs,RACGlyphs,RAC_FB);
322
WRAP_PICT_COND(CompositeRects,RACCompositeRects,RAC_FB);
324
WRAP_SCREEN_INFO_COND(AdjustFrame, RACAdjustFrame, RAC_VIEWPORT);
325
WRAP_SCREEN_INFO(SwitchMode, RACSwitchMode);
326
WRAP_SCREEN_INFO(EnterVT, RACEnterVT);
327
WRAP_SCREEN_INFO(LeaveVT, RACLeaveVT);
328
WRAP_SCREEN_INFO(FreeScreen, RACFreeScreen);
329
WRAP_SPRITE_COND(RAC_CURSOR);
336
RACCloseScreen (int i, ScreenPtr pScreen)
338
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
339
RACScreenPtr pScreenPriv =
340
(RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
341
miPointerScreenPtr PointPriv
342
= (miPointerScreenPtr)pScreen->devPrivates[miPointerScreenIndex].ptr;
344
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
347
DPRINT_S("RACCloseScreen",pScreen->myNum);
348
UNWRAP_SCREEN(CreateGC);
349
UNWRAP_SCREEN(CloseScreen);
350
UNWRAP_SCREEN(GetImage);
351
UNWRAP_SCREEN(GetSpans);
352
UNWRAP_SCREEN(SourceValidate);
353
UNWRAP_SCREEN(PaintWindowBackground);
354
UNWRAP_SCREEN(PaintWindowBorder);
355
UNWRAP_SCREEN(CopyWindow);
356
UNWRAP_SCREEN(ClearToBackground);
357
UNWRAP_SCREEN(BackingStoreFuncs.RestoreAreas);
358
UNWRAP_SCREEN(BackingStoreFuncs.SaveAreas);
359
UNWRAP_SCREEN(SaveScreen);
360
UNWRAP_SCREEN(StoreColors);
361
UNWRAP_SCREEN(DisplayCursor);
362
UNWRAP_SCREEN(RealizeCursor);
363
UNWRAP_SCREEN(UnrealizeCursor);
364
UNWRAP_SCREEN(RecolorCursor);
365
UNWRAP_SCREEN(SetCursorPosition);
367
UNWRAP_PICT(Composite);
369
UNWRAP_PICT(CompositeRects);
371
UNWRAP_SCREEN_INFO(AdjustFrame);
372
UNWRAP_SCREEN_INFO(SwitchMode);
373
UNWRAP_SCREEN_INFO(EnterVT);
374
UNWRAP_SCREEN_INFO(LeaveVT);
375
UNWRAP_SCREEN_INFO(FreeScreen);
378
xfree ((pointer) pScreenPriv);
380
if (xf86Screens[pScreen->myNum]->vtSema) {
381
xf86EnterServerState(SETUP);
384
return (*pScreen->CloseScreen) (i, pScreen);
389
DrawablePtr pDrawable,
390
int sx, int sy, int w, int h,
392
unsigned long planemask,
396
ScreenPtr pScreen = pDrawable->pScreen;
397
DPRINT_S("RACGetImage",pScreen->myNum);
398
SCREEN_PROLOG(GetImage);
399
if (xf86Screens[pScreen->myNum]->vtSema) {
402
(*pScreen->GetImage) (pDrawable, sx, sy, w, h,
403
format, planemask, pdstLine);
404
SCREEN_EPILOG (GetImage, RACGetImage);
409
DrawablePtr pDrawable,
417
ScreenPtr pScreen = pDrawable->pScreen;
419
DPRINT_S("RACGetSpans",pScreen->myNum);
420
SCREEN_PROLOG (GetSpans);
422
(*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
423
SCREEN_EPILOG (GetSpans, RACGetSpans);
428
DrawablePtr pDrawable,
429
int x, int y, int width, int height )
431
ScreenPtr pScreen = pDrawable->pScreen;
432
DPRINT_S("RACSourceValidate",pScreen->myNum);
433
SCREEN_PROLOG (SourceValidate);
435
if (pScreen->SourceValidate)
436
(*pScreen->SourceValidate) (pDrawable, x, y, width, height);
437
SCREEN_EPILOG (SourceValidate, RACSourceValidate);
441
RACPaintWindowBackground(
447
ScreenPtr pScreen = pWin->drawable.pScreen;
449
DPRINT_S("RACPaintWindowBackground",pScreen->myNum);
450
SCREEN_PROLOG (PaintWindowBackground);
452
(*pScreen->PaintWindowBackground) (pWin, prgn, what);
453
SCREEN_EPILOG (PaintWindowBackground, RACPaintWindowBackground);
457
RACPaintWindowBorder(
463
ScreenPtr pScreen = pWin->drawable.pScreen;
465
DPRINT_S("RACPaintWindowBorder",pScreen->myNum);
466
SCREEN_PROLOG (PaintWindowBorder);
468
(*pScreen->PaintWindowBorder) (pWin, prgn, what);
469
SCREEN_EPILOG (PaintWindowBorder, RACPaintWindowBorder);
475
DDXPointRec ptOldOrg,
478
ScreenPtr pScreen = pWin->drawable.pScreen;
480
DPRINT_S("RACCopyWindow",pScreen->myNum);
481
SCREEN_PROLOG (CopyWindow);
483
(*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
484
SCREEN_EPILOG (CopyWindow, RACCopyWindow);
488
RACClearToBackground (
492
Bool generateExposures )
494
ScreenPtr pScreen = pWin->drawable.pScreen;
496
DPRINT_S("RACClearToBackground",pScreen->myNum);
497
SCREEN_PROLOG ( ClearToBackground);
499
(*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures);
500
SCREEN_EPILOG (ClearToBackground, RACClearToBackground);
512
ScreenPtr pScreen = pPixmap->drawable.pScreen;
513
DPRINT_S("RACSaveAreas",pScreen->myNum);
514
SCREEN_PROLOG (BackingStoreFuncs.SaveAreas);
516
(*pScreen->BackingStoreFuncs.SaveAreas) (
517
pPixmap, prgnSave, xorg, yorg, pWin);
519
SCREEN_EPILOG (BackingStoreFuncs.SaveAreas, RACSaveAreas);
525
RegionPtr prgnRestore,
531
ScreenPtr pScreen = pPixmap->drawable.pScreen;
533
DPRINT_S("RACRestoreAreas",pScreen->myNum);
534
SCREEN_PROLOG (BackingStoreFuncs.RestoreAreas);
536
(*pScreen->BackingStoreFuncs.RestoreAreas) (
537
pPixmap, prgnRestore, xorg, yorg, pWin);
539
SCREEN_EPILOG ( BackingStoreFuncs.RestoreAreas, RACRestoreAreas);
543
RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
547
DPRINT_S("RACCreatePixmap",pScreen->myNum);
548
SCREEN_PROLOG ( CreatePixmap);
550
pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth);
551
SCREEN_EPILOG (CreatePixmap, RACCreatePixmap);
557
RACSaveScreen(ScreenPtr pScreen, Bool unblank)
561
DPRINT_S("RACSaveScreen",pScreen->myNum);
562
SCREEN_PROLOG (SaveScreen);
564
val = (*pScreen->SaveScreen) (pScreen, unblank);
565
SCREEN_EPILOG (SaveScreen, RACSaveScreen);
576
ScreenPtr pScreen = pmap->pScreen;
578
DPRINT_S("RACStoreColors",pScreen->myNum);
579
SCREEN_PROLOG (StoreColors);
581
(*pScreen->StoreColors) (pmap,ndef,pdefs);
583
SCREEN_EPILOG ( StoreColors, RACStoreColors);
593
DPRINT_S("RACRecolorCursor",pScreen->myNum);
594
SCREEN_PROLOG (RecolorCursor);
596
(*pScreen->RecolorCursor) (pScreen,pCurs,displayed);
598
SCREEN_EPILOG ( RecolorCursor, RACRecolorCursor);
609
DPRINT_S("RACRealizeCursor",pScreen->myNum);
610
SCREEN_PROLOG (RealizeCursor);
612
val = (*pScreen->RealizeCursor) (pScreen,pCursor);
614
SCREEN_EPILOG ( RealizeCursor, RACRealizeCursor);
626
DPRINT_S("RACUnrealizeCursor",pScreen->myNum);
627
SCREEN_PROLOG (UnrealizeCursor);
629
val = (*pScreen->UnrealizeCursor) (pScreen,pCursor);
631
SCREEN_EPILOG ( UnrealizeCursor, RACUnrealizeCursor);
643
DPRINT_S("RACDisplayCursor",pScreen->myNum);
644
SCREEN_PROLOG (DisplayCursor);
646
val = (*pScreen->DisplayCursor) (pScreen,pCursor);
648
SCREEN_EPILOG ( DisplayCursor, RACDisplayCursor);
653
RACSetCursorPosition (
660
DPRINT_S("RACSetCursorPosition",pScreen->myNum);
661
SCREEN_PROLOG (SetCursorPosition);
663
val = (*pScreen->SetCursorPosition) (pScreen,x,y,generateEvent);
665
SCREEN_EPILOG ( SetCursorPosition, RACSetCursorPosition);
670
RACAdjustFrame(int index, int x, int y, int flags)
672
ScreenPtr pScreen = screenInfo.screens[index];
673
RACScreenPtr pScreenPriv =
674
(RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
676
DPRINT_S("RACAdjustFrame",index);
677
xf86EnableAccess(xf86Screens[index]);
679
(*pScreenPriv->AdjustFrame)(index, x, y, flags);
683
RACSwitchMode(int index, DisplayModePtr mode, int flags)
685
ScreenPtr pScreen = screenInfo.screens[index];
686
RACScreenPtr pScreenPriv =
687
(RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
689
DPRINT_S("RACSwitchMode",index);
690
xf86EnableAccess(xf86Screens[index]);
692
return (*pScreenPriv->SwitchMode)(index, mode, flags);
696
RACEnterVT(int index, int flags)
698
ScreenPtr pScreen = screenInfo.screens[index];
699
RACScreenPtr pScreenPriv =
700
(RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
702
DPRINT_S("RACEnterVT",index);
703
xf86EnableAccess(xf86Screens[index]);
705
return (*pScreenPriv->EnterVT)(index, flags);
709
RACLeaveVT(int index, int flags)
711
ScreenPtr pScreen = screenInfo.screens[index];
712
RACScreenPtr pScreenPriv =
713
(RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
715
DPRINT_S("RACLeaveVT",index);
716
xf86EnableAccess(xf86Screens[index]);
718
(*pScreenPriv->LeaveVT)(index, flags);
722
RACFreeScreen(int index, int flags)
724
ScreenPtr pScreen = screenInfo.screens[index];
725
RACScreenPtr pScreenPriv =
726
(RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
728
DPRINT_S("RACFreeScreen",index);
729
xf86EnableAccess(xf86Screens[index]);
731
(*pScreenPriv->FreeScreen)(index, flags);
735
RACCreateGC(GCPtr pGC)
737
ScreenPtr pScreen = pGC->pScreen;
738
RACGCPtr pGCPriv = (RACGCPtr) (pGC)->devPrivates[RACGCIndex].ptr;
741
DPRINT_S("RACCreateGC",pScreen->myNum);
742
SCREEN_PROLOG(CreateGC);
744
ret = (*pScreen->CreateGC)(pGC);
747
SCREEN_EPILOG(CreateGC,RACCreateGC);
756
unsigned long changes,
760
DPRINT("RACValidateGC");
761
(*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
767
RACDestroyGC(GCPtr pGC)
770
DPRINT("RACDestroyGC");
771
(*pGC->funcs->DestroyGC)(pGC);
781
DPRINT("RACChangeGC");
782
(*pGC->funcs->ChangeGC) (pGC, mask);
794
(*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
806
DPRINT("RACChangeClip");
807
(*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
812
RACCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
815
DPRINT("RACCopyClip");
816
(* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
821
RACDestroyClip(GCPtr pGC)
824
DPRINT("RACDestroyClip");
825
(* pGC->funcs->DestroyClip)(pGC);
840
DPRINT("RACFillSpans");
842
(*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
851
register DDXPointPtr ppt,
857
DPRINT("RACSetSpans");
859
(*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
868
int x, int y, int w, int h,
874
DPRINT("RACPutImage");
876
(*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
877
leftPad, format, pImage);
887
int width, int height,
893
DPRINT("RACCopyArea");
895
ret = (*pGC->ops->CopyArea)(pSrc, pDst,
896
pGC, srcx, srcy, width, height, dstx, dsty);
907
int width, int height,
909
unsigned long bitPlane )
914
DPRINT("RACCopyPlane");
916
ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy,
917
width, height, dstx, dsty, bitPlane);
931
DPRINT("RACPolyPoint");
933
(*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
944
DDXPointPtr pptInit )
947
DPRINT("RACPolylines");
949
(*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
961
DPRINT("RACPolySegment");
963
(*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
972
xRectangle *pRectsInit )
975
DPRINT("RACPolyRectangle");
977
(*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
989
DPRINT("RACPolyArc");
991
(*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
1005
DPRINT("RACFillPolygon");
1007
(*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
1017
xRectangle *prectInit )
1020
DPRINT("RACPolyFillRect");
1022
(*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
1035
DPRINT("RACPolyFillArc");
1037
(*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
1053
DPRINT("RACPolyText8");
1055
ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
1067
unsigned short *chars )
1072
DPRINT("RACPolyText16");
1074
ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
1089
DPRINT("RACImageText8");
1091
(*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
1102
unsigned short *chars )
1105
DPRINT("RACImageText16");
1107
(*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
1116
int xInit, int yInit,
1117
unsigned int nglyph,
1119
pointer pglyphBase )
1122
DPRINT("RACImageGlyphBlt");
1124
(*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit,
1125
nglyph, ppci, pglyphBase);
1133
int xInit, int yInit,
1134
unsigned int nglyph,
1136
pointer pglyphBase )
1139
DPRINT("RACPolyGlyphBlt");
1141
(*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit,
1142
nglyph, ppci, pglyphBase);
1151
int dx, int dy, int xOrg, int yOrg )
1154
DPRINT("RACPushPixels");
1156
(*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
1163
RACSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCur)
1167
DPRINT_S("RACSpriteRealizeCursor",pScreen->myNum);
1169
val = PointPriv->spriteFuncs->RealizeCursor(pScreen, pCur);
1175
RACSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCur)
1179
DPRINT_S("RACSpriteUnrealizeCursor",pScreen->myNum);
1181
val = PointPriv->spriteFuncs->UnrealizeCursor(pScreen, pCur);
1187
RACSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCur, int x, int y)
1190
DPRINT_S("RACSpriteSetCursor",pScreen->myNum);
1192
PointPriv->spriteFuncs->SetCursor(pScreen, pCur, x, y);
1197
RACSpriteMoveCursor(ScreenPtr pScreen, int x, int y)
1200
DPRINT_S("RACSpriteMoveCursor",pScreen->myNum);
1202
PointPriv->spriteFuncs->MoveCursor(pScreen, x, y);
1208
RACComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
1209
PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask,
1210
INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width,
1213
ScreenPtr pScreen = pDst->pDrawable->pScreen;
1214
PictureScreenPtr ps = GetPictureScreen(pScreen);
1216
PICTURE_PROLOGUE(Composite);
1219
(*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst,
1220
yDst, width, height);
1222
PICTURE_EPILOGUE(Composite, RACComposite);
1226
RACGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
1227
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist,
1228
GlyphListPtr list, GlyphPtr *glyphs)
1230
ScreenPtr pScreen = pDst->pDrawable->pScreen;
1231
PictureScreenPtr ps = GetPictureScreen(pScreen);
1233
PICTURE_PROLOGUE(Glyphs);
1236
(*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
1238
PICTURE_EPILOGUE (Glyphs, RACGlyphs);
1242
RACCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRect,
1245
ScreenPtr pScreen = pDst->pDrawable->pScreen;
1246
PictureScreenPtr ps = GetPictureScreen(pScreen);
1248
PICTURE_PROLOGUE(CompositeRects);
1251
(*ps->CompositeRects)(op, pDst, color, nRect, rects);
1253
PICTURE_EPILOGUE (CompositeRects, RACCompositeRects);