diff options
author | Adam Jackson <ajax@redhat.com> | 2015-02-25 16:03:13 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2015-09-24 13:01:51 -0400 |
commit | b469fc72d2dd0cf60760fa0828ed73771c2a0512 (patch) | |
tree | b34279bfc9426e54b9ef13e762ebd6306b49d539 | |
parent | 6da3f5d04f6a1cda0c858280f9561f9fbc323275 (diff) |
composite: Factor out backing store transition
No functional change.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r-- | composite/compinit.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/composite/compinit.c b/composite/compinit.c index cf61f2a57..791fec922 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -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; |