summaryrefslogtreecommitdiff
path: root/dix/gc.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-08-28 09:28:25 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-08-28 09:28:25 -0400
commit4017d3190234e189a0bbd33193a148d4d3c7556b (patch)
tree2ab228113d410386afde50c893f137d95974b8f3 /dix/gc.c
parent85547073265ae9bc4ae3af920a6d3214fd1ca0c5 (diff)
devPrivates rework: since API is already broken, switch everything
over to new system. Need to update documentation and address some remaining vestiges of old system such as CursorRec structure, fb "offman" structure, and FontRec privates.
Diffstat (limited to 'dix/gc.c')
-rw-r--r--dix/gc.c42
1 files changed, 5 insertions, 37 deletions
diff --git a/dix/gc.c b/dix/gc.c
index ccd586bdd..d77932c9e 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -573,45 +573,13 @@ BUG:
should check for failure to create default tile
*/
-
-static GCPtr
-AllocateGC(ScreenPtr pScreen)
-{
- GCPtr pGC;
- char *ptr;
- DevUnion *ppriv;
- unsigned *sizes;
- unsigned size;
- int i;
-
- pGC = (GCPtr)xalloc(pScreen->totalGCSize);
- if (pGC)
- {
- ppriv = (DevUnion *)(pGC + 1);
- pGC->devPrivates = ppriv;
- sizes = pScreen->GCPrivateSizes;
- ptr = (char *)(ppriv + pScreen->GCPrivateLen);
- for (i = pScreen->GCPrivateLen; --i >= 0; ppriv++, sizes++)
- {
- if ( (size = *sizes) )
- {
- ppriv->ptr = (pointer)ptr;
- ptr += size;
- }
- else
- ppriv->ptr = (pointer)NULL;
- }
- }
- return pGC;
-}
-
_X_EXPORT GCPtr
CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
XID gcid, ClientPtr client)
{
GCPtr pGC;
- pGC = AllocateGC(pDrawable->pScreen);
+ pGC = (GCPtr)xalloc(sizeof(GC));
if (!pGC)
{
*pStatus = BadAlloc;
@@ -624,7 +592,7 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
pGC->planemask = ~0;
pGC->serialNumber = GC_CHANGE_SERIAL_BIT;
pGC->funcs = 0;
-
+ pGC->devPrivates = NULL;
pGC->fgPixel = 0;
pGC->bgPixel = 1;
pGC->lineWidth = 0;
@@ -918,7 +886,7 @@ FreeGC(pointer value, XID gid)
(*pGC->funcs->DestroyGC) (pGC);
if (pGC->dash != DefaultDash)
xfree(pGC->dash);
- dixFreePrivates(*DEVPRIV_PTR(pGC));
+ dixFreePrivates(pGC->devPrivates);
xfree(pGC);
return(Success);
}
@@ -941,7 +909,7 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
{
GCPtr pGC;
- pGC = AllocateGC(pScreen);
+ pGC = (GCPtr)xalloc(sizeof(GC));
if (!pGC)
return (GCPtr)NULL;
@@ -950,7 +918,7 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
pGC->alu = GXcopy; /* dst <- src */
pGC->planemask = ~0;
pGC->serialNumber = 0;
-
+ pGC->devPrivates = NULL;
pGC->fgPixel = 0;
pGC->bgPixel = 1;
pGC->lineWidth = 0;