[PATCH 7/8] composite: Factor out backing store transition

Adam Jackson ajax at redhat.com
Mon Nov 17 12:41:14 PST 2014


No functional change.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 composite/compinit.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/composite/compinit.c b/composite/compinit.c
index 10433a1..09d58a0 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;
 
-- 
1.9.3



More information about the xorg-devel mailing list