Commit b469fc72 authored by Adam Jackson's avatar Adam Jackson

composite: Factor out backing store transition

No functional change.
Reviewed-by: default avatarKeith Packard <keithp@keithp.com>
Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
parent 6da3f5d0
......@@ -105,6 +105,20 @@ compInstallColormap(ColormapPtr pColormap)
pScreen->InstallColormap = compInstallColormap;
}
static void
compCheckBackingStore(WindowPtr pWin)
{
if (pWin->backingStore != NotUseful && !pWin->backStorage) {
compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
pWin->backStorage = TRUE;
}
else if (pWin->backingStore == NotUseful && pWin->backStorage) {
compUnredirectWindow(serverClient, pWin,
CompositeRedirectAutomatic);
pWin->backStorage = FALSE;
}
}
/* Fake backing store via automatic redirection */
static Bool
compChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
......@@ -117,17 +131,8 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
ret = pScreen->ChangeWindowAttributes(pWin, mask);
if (ret && (mask & CWBackingStore) &&
pScreen->backingStoreSupport != NotUseful) {
if (pWin->backingStore != NotUseful && !pWin->backStorage) {
compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
pWin->backStorage = TRUE;
}
else if (pWin->backingStore == NotUseful && pWin->backStorage) {
compUnredirectWindow(serverClient, pWin,
CompositeRedirectAutomatic);
pWin->backStorage = FALSE;
}
}
pScreen->backingStoreSupport != NotUseful)
compCheckBackingStore(pWin);
pScreen->ChangeWindowAttributes = compChangeWindowAttributes;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment