Delete redundant GC initializations.

When a GC is allocated, it is zeroed, including all storage requested
with dixRegisterPrivateKey. So CreateGC hooks don't need to initialize
anything to zero.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
This commit is contained in:
Jamey Sharp 2010-05-23 17:15:43 -07:00
parent 3288232f3d
commit bbbf795e6b
6 changed files with 1 additions and 22 deletions

View File

@ -64,19 +64,13 @@ const GCOps fbGCOps = {
Bool
fbCreateGC(GCPtr pGC)
{
pGC->clientClip = NULL;
pGC->clientClipType = CT_NONE;
pGC->ops = (GCOps *) &fbGCOps;
pGC->funcs = (GCFuncs *) &fbGCFuncs;
/* fb wants to translate before scan conversion */
pGC->miTranslate = 1;
pGC->fExpose = 1;
fbGetRotatedPixmap(pGC) = 0;
fbGetExpose(pGC) = 1;
fbGetFreeCompClip(pGC) = 0;
fbGetCompositeClip(pGC) = 0;
fbGetGCPrivate(pGC)->bpp = BitsPerPixel (pGC->depth);
return TRUE;
}

View File

@ -48,11 +48,6 @@ XAACreateGC(GCPtr pGC)
pGCPriv->wrapOps = NULL;
pGCPriv->wrapFuncs = pGC->funcs;
pGCPriv->XAAOps = &XAAFallbackOps;
pGCPriv->flags = 0;
pGCPriv->DashLength = 0;
pGCPriv->DashPattern = NULL;
pGCPriv->changes = 0;
/* initialize any other private fields here */
pGC->funcs = &XAAGCFuncs;
}

View File

@ -73,9 +73,6 @@ static GCOps xnestOps = {
Bool
xnestCreateGC(GCPtr pGC)
{
pGC->clientClipType = CT_NONE;
pGC->clientClip = NULL;
pGC->funcs = &xnestFuncs;
pGC->ops = &xnestOps;

View File

@ -137,11 +137,6 @@ winCreateGCNativeGDI (GCPtr pGC)
pGC->depth);
#endif
pGC->clientClip = NULL;
pGC->clientClipType = CT_NONE;
pGC->freeCompClip = FALSE;
pGC->pCompositeClip = 0;
pGC->ops = (GCOps *) &winGCOps;
pGC->funcs = (GCFuncs *) &winGCFuncs;

View File

@ -325,7 +325,6 @@ cwCreateGC(GCPtr pGC)
ScreenPtr pScreen = pGC->pScreen;
Bool ret;
memset(pPriv, 0, sizeof(cwGCRec));
SCREEN_PROLOGUE(pScreen, CreateGC);
if ( (ret = (*pScreen->CreateGC)(pGC)) )

View File

@ -446,7 +446,6 @@ damageCreateGC(GCPtr pGC)
damageGCPriv(pGC);
Bool ret;
pGC->pCompositeClip = 0;
unwrap (pScrPriv, pScreen, CreateGC);
if((ret = (*pScreen->CreateGC) (pGC))) {
pGCPriv->ops = NULL;