summaryrefslogtreecommitdiff
path: root/composite/compinit.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@benzedrine.nwnk.net>2007-08-25 15:08:20 -0400
committerAdam Jackson <ajax@benzedrine.nwnk.net>2007-08-25 15:08:20 -0400
commitae7f71a8b3d6756161e55d998d6eec37d2695c98 (patch)
tree062e2a706da974db9e40c0fabf25c32355a26916 /composite/compinit.c
parentbf0883ae5081bd75569115a3eb27c6d3d336c9f2 (diff)
Implement core protocol backing store exclusively in terms of Composite.
Composite's automatic redirection is a more general mechanism than the ad-hoc BS machinery, so it's much prettier to implement the one in terms of the other. Composite now wraps ChangeWindowAttributes and activates automatic redirection for windows with backing store requested. The old backing store infrastructure is completely gutted: ABI-visible structures retain the function pointers, but they never get called, and all the open-coded conditionals throughout the DIX layer to implement BS are gone. Note that this is still not a strictly complete implementation of backing store, since Composite will throw the bits away on unmap and therefore WhenMapped and Always hints are equivalent.
Diffstat (limited to 'composite/compinit.c')
-rw-r--r--composite/compinit.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/composite/compinit.c b/composite/compinit.c
index 630f1042c..c557eebc4 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -63,6 +63,7 @@ compCloseScreen (int index, ScreenPtr pScreen)
pScreen->CloseScreen = cs->CloseScreen;
pScreen->BlockHandler = cs->BlockHandler;
pScreen->InstallColormap = cs->InstallColormap;
+ pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes;
pScreen->ReparentWindow = cs->ReparentWindow;
pScreen->MoveWindow = cs->MoveWindow;
pScreen->ResizeWindow = cs->ResizeWindow;
@@ -109,6 +110,33 @@ compInstallColormap (ColormapPtr pColormap)
pScreen->InstallColormap = compInstallColormap;
}
+/* Fake backing store via automatic redirection */
+static Bool
+compChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ CompScreenPtr cs = GetCompScreen (pScreen);
+ Bool ret;
+
+ pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes;
+ ret = pScreen->ChangeWindowAttributes(pWin, mask);
+
+ if (ret && (mask & CWBackingStore)) {
+ if (pWin->backingStore != NotUseful) {
+ compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
+ pWin->backStorage = TRUE;
+ } else {
+ compUnredirectWindow(serverClient, pWin,
+ CompositeRedirectAutomatic);
+ pWin->backStorage = FALSE;
+ }
+ }
+
+ pScreen->ChangeWindowAttributes = compChangeWindowAttributes;
+
+ return ret;
+}
+
static void
compScreenUpdate (ScreenPtr pScreen)
{
@@ -424,6 +452,9 @@ compScreenInit (ScreenPtr pScreen)
cs->InstallColormap = pScreen->InstallColormap;
pScreen->InstallColormap = compInstallColormap;
+ cs->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
+ pScreen->ChangeWindowAttributes = compChangeWindowAttributes;
+
cs->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = compBlockHandler;