diff options
author | Keith Packard <keithp@keithp.com> | 2004-08-07 01:02:41 +0000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2004-08-07 01:02:41 +0000 |
commit | 2bdbc2c0d39b1618440a6a8ed1c38a11703e898c (patch) | |
tree | 5f5fa3e273fdd6ea8c40da4ac49dd1a82f9152c9 /miext/cw/cw.c | |
parent | cff0043a347ba06e8ab16a84a35c99794b45149b (diff) |
Clean up cw initialization, make sure wrappers re-wrap on exit.
Diffstat (limited to 'miext/cw/cw.c')
-rw-r--r-- | miext/cw/cw.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/miext/cw/cw.c b/miext/cw/cw.c index 708ebe323..4a73d8be2 100644 --- a/miext/cw/cw.c +++ b/miext/cw/cw.c @@ -344,8 +344,7 @@ cwCheapValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable) * cwCreateGCPrivate will wrap with the backing-pixmap GC funcs and we won't * re-wrap on return. */ - if (pDrawable->type == DRAWABLE_WINDOW && - cwDrawableIsRedirWindow(pDrawable) && + if (cwDrawableIsRedirWindow(pDrawable) && cwCreateGCPrivate(pGC, pDrawable)) { (*pGC->funcs->ValidateGC)(pGC, stateChanges, pDrawable); @@ -427,11 +426,11 @@ cwCheapDestroyClip(GCPtr pGC) */ #define SCREEN_PROLOGUE(pScreen, field)\ - ((pScreen)->field = ((cwScreenPtr) \ - (pScreen)->devPrivates[cwScreenIndex].ptr)->field) + ((pScreen)->field = getCwScreen(pScreen)->field) #define SCREEN_EPILOGUE(pScreen, field, wrapper)\ - ((pScreen)->field = wrapper) + ((getCwScreen(pScreen)->field = (pScreen)->field), \ + ((pScreen)->field = (wrapper))) static Bool cwCreateGC(GCPtr pGC) @@ -667,21 +666,14 @@ miInitializeCompositeWrapper(ScreenPtr pScreen) if (!pScreenPriv) return; - pScreenPriv->CloseScreen = pScreen->CloseScreen; - pScreenPriv->GetImage = pScreen->GetImage; - pScreenPriv->GetSpans = pScreen->GetSpans; - pScreenPriv->CreateGC = pScreen->CreateGC; - pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground; - pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder; - - pScreen->CloseScreen = cwCloseScreen; - pScreen->GetImage = cwGetImage; - pScreen->GetSpans = cwGetSpans; - pScreen->CreateGC = cwCreateGC; - pScreen->PaintWindowBackground = cwPaintWindowBackground; - pScreen->PaintWindowBorder = cwPaintWindowBorder; - pScreen->devPrivates[cwScreenIndex].ptr = (pointer)pScreenPriv; + + SCREEN_EPILOGUE(pScreen, CloseScreen, cwCloseScreen); + SCREEN_EPILOGUE(pScreen, GetImage, cwGetImage); + SCREEN_EPILOGUE(pScreen, GetSpans, cwGetSpans); + SCREEN_EPILOGUE(pScreen, CreateGC, cwCreateGC); + SCREEN_EPILOGUE(pScreen, PaintWindowBackground, cwPaintWindowBackground); + SCREEN_EPILOGUE(pScreen, PaintWindowBorder, cwPaintWindowBorder); #ifdef RENDER if (GetPictureScreen (pScreen)) |