summaryrefslogtreecommitdiff
path: root/miext
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-03-27 17:31:28 -0700
committerEric Anholt <eric@anholt.net>2007-03-27 17:31:28 -0700
commit6ed08949af4f7ac09170d3d9581e4092b24a84ee (patch)
treeff55cb5dab8f0585ffe53cc6fac5e987c0db883e /miext
parente76b6349516d5d1c8f7167d6f5419e0d06a546c3 (diff)
Move libcw setup to the only renderer requiring it (XAA).
Additionally, protect libcw setup behind checks for Render, to avoid segfaulting if Render isn't available (xnest). The previous setup was an ABI-preserving dance, which is better nuked now. Now, anything that needs libcw must explicitly initialize it, and miDisableCompositeWrapper (previously only called by EXA and presumably binary drivers) is gone.
Diffstat (limited to 'miext')
-rw-r--r--miext/cw/cw.c24
-rw-r--r--miext/cw/cw.h4
-rwxr-xr-xmiext/damage/damage.c10
3 files changed, 10 insertions, 28 deletions
diff --git a/miext/cw/cw.c b/miext/cw/cw.c
index f60f8cf28..69502711a 100644
--- a/miext/cw/cw.c
+++ b/miext/cw/cw.c
@@ -50,7 +50,6 @@ int cwWindowIndex;
#ifdef RENDER
int cwPictureIndex;
#endif
-static Bool cwDisabled[MAXSCREENS];
static unsigned long cwGeneration = 0;
extern GCOps cwGCOps;
@@ -619,9 +618,9 @@ void
miInitializeCompositeWrapper(ScreenPtr pScreen)
{
cwScreenPtr pScreenPriv;
-
- if (cwDisabled[pScreen->myNum])
- return;
+#ifdef RENDER
+ Bool has_render = GetPictureScreenIfSet(pScreen) != NULL;
+#endif
if (cwGeneration != serverGeneration)
{
@@ -631,7 +630,8 @@ miInitializeCompositeWrapper(ScreenPtr pScreen)
cwGCIndex = AllocateGCPrivateIndex();
cwWindowIndex = AllocateWindowPrivateIndex();
#ifdef RENDER
- cwPictureIndex = AllocatePicturePrivateIndex();
+ if (has_render)
+ cwPictureIndex = AllocatePicturePrivateIndex();
#endif
cwGeneration = serverGeneration;
}
@@ -640,8 +640,10 @@ miInitializeCompositeWrapper(ScreenPtr pScreen)
if (!AllocateWindowPrivate(pScreen, cwWindowIndex, 0))
return;
#ifdef RENDER
- if (!AllocatePicturePrivate(pScreen, cwPictureIndex, 0))
- return;
+ if (has_render) {
+ if (!AllocatePicturePrivate(pScreen, cwPictureIndex, 0))
+ return;
+ }
#endif
pScreenPriv = (cwScreenPtr)xalloc(sizeof(cwScreenRec));
if (!pScreenPriv)
@@ -661,17 +663,11 @@ miInitializeCompositeWrapper(ScreenPtr pScreen)
SCREEN_EPILOGUE(pScreen, GetWindowPixmap, cwGetWindowPixmap);
#ifdef RENDER
- if (GetPictureScreen (pScreen))
+ if (has_render)
cwInitializeRender(pScreen);
#endif
}
-_X_EXPORT void
-miDisableCompositeWrapper(ScreenPtr pScreen)
-{
- cwDisabled[pScreen->myNum] = TRUE;
-}
-
static Bool
cwCloseScreen (int i, ScreenPtr pScreen)
{
diff --git a/miext/cw/cw.h b/miext/cw/cw.h
index 09cfc7828..69abbbfed 100644
--- a/miext/cw/cw.h
+++ b/miext/cw/cw.h
@@ -169,7 +169,3 @@ cwFiniRender (ScreenPtr pScreen);
void
miInitializeCompositeWrapper(ScreenPtr pScreen);
-
-/* Must be called before miInitializeCompositeWrapper */
-void
-miDisableCompositeWrapper(ScreenPtr pScreen);
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index 6f1ee2894..d93074758 100755
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -1831,16 +1831,6 @@ DamageSetup (ScreenPtr pScreen)
if (!pScrPriv)
return FALSE;
-#ifdef COMPOSITE
- /* This is a kludge to ensure wrapping order with the composite wrapper.
- * If it's done from compinit.c, then DamageSetup may be called before the
- * extension init phase, so that cw will be higher in the wrapping chain and
- * rewrite drawables before damage gets to it, causing confusion.
- */
- if (!noCompositeExtension)
- miInitializeCompositeWrapper (pScreen);
-#endif
-
pScrPriv->internalLevel = 0;
pScrPriv->pScreenDamage = 0;