diff options
Diffstat (limited to 'drv')
-rw-r--r-- | drv/drv_gc.c | 4 | ||||
-rw-r--r-- | drv/drv_gcstruct.h | 37 | ||||
-rw-r--r-- | drv/exa/exa.c | 111 | ||||
-rw-r--r-- | drv/exa/exa_priv.h | 5 | ||||
-rw-r--r-- | drv/fb/fbgc.c | 12 | ||||
-rw-r--r-- | drv/impedgc.c | 2 | ||||
-rw-r--r-- | drv/mi/Makefile.am | 3 | ||||
-rw-r--r-- | drv/mi/gen_mi_files | 29 | ||||
-rw-r--r-- | drv/mi/mi_sharelist.txt | 2 |
9 files changed, 167 insertions, 38 deletions
diff --git a/drv/drv_gc.c b/drv/drv_gc.c index f569d91b4..282b0bd17 100644 --- a/drv/drv_gc.c +++ b/drv/drv_gc.c @@ -37,8 +37,8 @@ static void DrvCheckClip(DrvPixmapPtr pPixmap, DrvGCPtr pGC) void DrvValidateGC(DrvPixmapPtr pPixmap, DrvGCPtr pGC) { - (*pGC->ops->GPUValidateGC) (pGC, pGC->stateChanges, pPixmap); - DrvCheckClip(pPixmap, pGC); + (*pGC->funcs->ValidateGC) (pGC, pGC->stateChanges, pPixmap); + DrvCheckClip(pPixmap, pGC); pGC->stateChanges = 0; // pGC->serialNumber = pDraw->serialNumber; } diff --git a/drv/drv_gcstruct.h b/drv/drv_gcstruct.h index 1a8519302..361833cc8 100644 --- a/drv/drv_gcstruct.h +++ b/drv/drv_gcstruct.h @@ -8,6 +8,38 @@ #include "drv_pixmap.h" #include "privates.h" +typedef struct _DrvGCFuncs { + void (* ValidateGC)( + DrvGCPtr /*pGC*/, + unsigned long /*stateChanges*/, + DrvPixmapPtr /*pDrawable*/); + + void (* ChangeGC)( + DrvGCPtr /*pGC*/, + unsigned long /*mask*/); + + void (* CopyGC)( + DrvGCPtr /*pGCSrc*/, + unsigned long /*mask*/, + DrvGCPtr /*pGCDst*/); + + void (* DestroyGC)( + DrvGCPtr /*pGC*/); + + void (* ChangeClip)( + DrvGCPtr /*pGC*/, + int /*type*/, + pointer /*pvalue*/, + int /*nrects*/); + + void (* DestroyClip)( + DrvGCPtr /*pGC*/); + + void (* CopyClip)( + DrvGCPtr /*pgcDst*/, + DrvGCPtr /*pgcSrc*/); +} DrvGCFuncs; + typedef struct _DrvGCOps { void (* FillSpans)( DrvPixmapPtr /*pDrawable*/, @@ -171,10 +203,6 @@ typedef struct _DrvGCOps { int /*x*/, int /*y*/); - void (* GPUValidateGC)( - DrvGCPtr /*pGC*/, - unsigned long /*stateChanges*/, - DrvPixmapPtr /*pDrawable*/); } DrvGCOps; typedef struct _DrvGC { @@ -214,6 +242,7 @@ typedef struct _DrvGC { pointer clientClip; unsigned long stateChanges; /* masked with GC_<kind> */ unsigned long serialNumber; + DrvGCFuncs *funcs; DrvGCOps *ops; PrivateRec *devPrivates; /* diff --git a/drv/exa/exa.c b/drv/exa/exa.c index 71ecf8c0a..31d4aa596 100644 --- a/drv/exa/exa.c +++ b/drv/exa/exa.c @@ -449,7 +449,46 @@ exaDestroyPixmap(DrvPixmapPtr pPixmap) * Do not ever access the fb/mi layer directly. */ -void +static void +exaValidateGC(DrvGCPtr pGC, + unsigned long changes, + DrvPixmapPtr pPixmap); + +static void +exaDestroyGC(DrvGCPtr pGC); + +static void +exaChangeGC (DrvGCPtr pGC, + unsigned long mask); + +static void +exaCopyGC (DrvGCPtr pGCSrc, + unsigned long mask, + DrvGCPtr pGCDst); + +static void +exaChangeClip (DrvGCPtr pGC, + int type, + pointer pvalue, + int nrects); + +static void +exaCopyClip(DrvGCPtr pGCDst, DrvGCPtr pGCSrc); + +static void +exaDestroyClip(DrvGCPtr pGC); + +const DrvGCFuncs drvexaGCFuncs = { + exaValidateGC, + exaChangeGC, + exaCopyGC, + exaDestroyGC, + exaChangeClip, + exaDestroyClip, + exaCopyClip +}; + +static void exaValidateGC(DrvGCPtr pGC, unsigned long changes, DrvPixmapPtr pPixmap) @@ -490,9 +529,9 @@ exaValidateGC(DrvGCPtr pGC, /* Calls to Create/DestroyPixmap have to be identified as special. */ pExaScr->fallback_counter++; - swap(pExaGC, pGC, ops); - (*pGC->ops->GPUValidateGC)(pGC, changes, pPixmap); - swap(pExaGC, pGC, ops); + swap(pExaGC, pGC, funcs); + (*pGC->funcs->ValidateGC)(pGC, changes, pPixmap); + swap(pExaGC, pGC, funcs); pExaScr->fallback_counter--; if (pTile) @@ -503,6 +542,68 @@ exaValidateGC(DrvGCPtr pGC, exaFinishAccess(pGC->stipple, DRV_EXA_PREPARE_MASK); } +/* Is exaPrepareAccessGC() needed? */ +static void +exaDestroyGC(DrvGCPtr pGC) +{ + ExaGCPriv(pGC); + swap(pExaGC, pGC, funcs); + (*pGC->funcs->DestroyGC)(pGC); + swap(pExaGC, pGC, funcs); +} + + +static void +exaChangeGC (DrvGCPtr pGC, + unsigned long mask) +{ + ExaGCPriv(pGC); + swap(pExaGC, pGC, funcs); + (*pGC->funcs->ChangeGC) (pGC, mask); + swap(pExaGC, pGC, funcs); +} + +static void +exaCopyGC (DrvGCPtr pGCSrc, + unsigned long mask, + DrvGCPtr pGCDst) +{ + ExaGCPriv(pGCDst); + swap(pExaGC, pGCDst, funcs); + (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); + swap(pExaGC, pGCDst, funcs); +} + +static void +exaChangeClip (DrvGCPtr pGC, + int type, + pointer pvalue, + int nrects) +{ + ExaGCPriv(pGC); + swap(pExaGC, pGC, funcs); + (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); + swap(pExaGC, pGC, funcs); +} + +static void +exaCopyClip(DrvGCPtr pGCDst, DrvGCPtr pGCSrc) +{ + ExaGCPriv(pGCDst); + swap(pExaGC, pGCDst, funcs); + (*pGCDst->funcs->CopyClip)(pGCDst, pGCSrc); + swap(pExaGC, pGCDst, funcs); +} + +static void +exaDestroyClip(DrvGCPtr pGC) +{ + ExaGCPriv(pGC); + swap(pExaGC, pGC, funcs); + (*pGC->funcs->DestroyClip)(pGC); + swap(pExaGC, pGC, funcs); +} + /** * exaCreateGC makes a new GC and hooks up its funcs handler, so that @@ -518,7 +619,7 @@ exaCreateGC (DrvGCPtr pGC) swap(pExaScr, pScreen, CreateGC); if ((ret = (*pScreen->CreateGC) (pGC))) { - // wrap(pExaGC, pGC, funcs, (GCFuncs *) &exaGCFuncs); + wrap(pExaGC, pGC, funcs, (DrvGCFuncs *) &drvexaGCFuncs); wrap(pExaGC, pGC, ops, (DrvGCOps *) &exaOps); } swap(pExaScr, pScreen, CreateGC); diff --git a/drv/exa/exa_priv.h b/drv/exa/exa_priv.h index 9053399ba..f09619761 100644 --- a/drv/exa/exa_priv.h +++ b/drv/exa/exa_priv.h @@ -241,10 +241,6 @@ extern DevPrivateKeyRec drvexaGCPrivateKeyRec; #define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixGetPrivateAddr(&(gc)->devPrivates, exaGCPrivateKey)) #define ExaGCPriv(gc) ExaGCPrivPtr pExaGC = ExaGetGCPriv(gc) -void -exaValidateGC(DrvGCPtr pGC, - unsigned long changes, - DrvPixmapPtr pPixmap); /* * Some macros to deal with function wrapping. */ @@ -343,6 +339,7 @@ typedef struct { typedef struct { /* GC values from the layer below. */ DrvGCOps *Savedops; + DrvGCFuncs *Savedfuncs; } ExaGCPrivRec, *ExaGCPrivPtr; typedef struct { diff --git a/drv/fb/fbgc.c b/drv/fb/fbgc.c index 6f816d0c3..6471a8833 100644 --- a/drv/fb/fbgc.c +++ b/drv/fb/fbgc.c @@ -30,6 +30,16 @@ //#include "imped.h" +const DrvGCFuncs drvfbGCFuncs = { + drvfbValidateGC, + drvmiChangeGC, + drvmiCopyGC, + drvmiDestroyGC, + drvmiChangeClip, + drvmiDestroyClip, + drvmiCopyClip, +}; + const DrvGCOps drvfbGCOps = { drvfbFillSpans, drvfbSetSpans, @@ -51,13 +61,13 @@ const DrvGCOps drvfbGCOps = { drvfbImageGlyphBlt, drvfbPolyGlyphBlt, drvfbPushPixels, - drvfbValidateGC, }; Bool drvfbCreateGC(DrvGCPtr pGC) { pGC->ops = (DrvGCOps *) &drvfbGCOps; + pGC->funcs = (DrvGCOps *) &drvfbGCFuncs; drvfbGetGCPrivate(pGC)->bpp = BitsPerPixel (pGC->depth); return TRUE; } diff --git a/drv/impedgc.c b/drv/impedgc.c index af249e071..5f76d3d98 100644 --- a/drv/impedgc.c +++ b/drv/impedgc.c @@ -114,7 +114,7 @@ impedValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) SyncDrvGC(pGC, pDrvGC, i); - pDrvGC->ops->GPUValidateGC(pDrvGC, changes, imped_pixmap->gpu[i]); + pDrvGC->funcs->ValidateGC(pDrvGC, changes, imped_pixmap->gpu[i]); } #ifdef COMPOSITE if (pDrawable->type == DRAWABLE_WINDOW) { diff --git a/drv/mi/Makefile.am b/drv/mi/Makefile.am index cdacd3df7..741ee0701 100644 --- a/drv/mi/Makefile.am +++ b/drv/mi/Makefile.am @@ -26,4 +26,5 @@ libdrvmi_la_SOURCES = \ drvmipolytext.c\ drvmizerclip.c\ drvmizerline.c\ - drvmipoly.c + drvmipoly.c \ + drvmigc.c diff --git a/drv/mi/gen_mi_files b/drv/mi/gen_mi_files index ca97fe5e6..ecfd2b93b 100644 --- a/drv/mi/gen_mi_files +++ b/drv/mi/gen_mi_files @@ -19,31 +19,20 @@ for i in `cat mi-exported-syms.txt` do echo "s/"$i"/drv"$i"/g" >> mi.sed done -echo "s/PictureScreenPtr/DrvPictureScreenPtr/g" >> mi.sed -echo "s/ScreenPtr/DrvScreenPtr/g" >> mi.sed -echo "s/DrvPictureDrvScreenPtr/DrvPictureScreenPtr/g" >> mi.sed -echo "s/pScreen/pDrvScreen/g" >> mi.sed -echo "s/PixmapPtr/DrvPixmapPtr/g" >> mi.sed -echo "s/PicturePtr/DrvPicturePtr/g" >> mi.sed -echo "s/DrawablePtr/DrvPixmapPtr/g" >> mi.sed -echo "s/GCPtr/DrvGCPtr/g" >> mi.sed -echo "s/scrnintstr.h/drv_scrnintstr.h/g" >> mi.sed -echo "s/pixmapstr.h/drv_pixmapstr.h/g" >> mi.sed -echo "s/windowstr.h/drv_pixmapstr.h/g" >> mi.sed -echo "s/gcstruct.h/drv_gcstruct.h/g" >> mi.sed -echo "s/picturestr.h/drv_picturestr.h/g" >> mi.sed -echo "s/damage.h/drv_damage.h/g" >> mi.sed -echo "s/mi.h/drv_mi.h/g" >> mi.sed +cat ../dix.sed >> mi.sed +for i in `cat ../dix-symbols.txt` +do + echo "s/"$i"/drv"$i"/g" >> mi.sed +done + +echo "s/mi\.h/drv_mi.h/g" >> mi.sed echo "s/miClearDrawable/drvClearPixmap/g" >> mi.sed echo "s/miZeroArcRec/drvmiZeroArcRec/g" >> mi.sed echo "s/miZeroArcPtRec/drvmiZeroArcPtRec/g" >> mi.sed echo "s/miGetZeroLineBias/drvmiGetZeroLineBias/g" >> mi.sed echo "s/miCanZeroArc/drvmiCanZeroArc/g" >> mi.sed - -for i in `cat ../dix-symbols.txt` -do - echo "s/"$i"/drv"$i"/g" >> mi.sed -done +echo "s/miGlyphs/drvmiGlyphs/g" >> mi.sed +echo "s/midrv/mi/g" >> mi.sed for i in `cat $1 | grep \.h$` do diff --git a/drv/mi/mi_sharelist.txt b/drv/mi/mi_sharelist.txt index b2afdcd3c..b7a680fb0 100644 --- a/drv/mi/mi_sharelist.txt +++ b/drv/mi/mi_sharelist.txt @@ -24,3 +24,5 @@ mizerarc.c mizerarc.h mizerclip.c mizerline.c +migc.c +migc.h |