[Xfce4-commits] [xfce/xfwm4] 01/01: compositor: Small optimization with zoom on GLX

noreply at xfce.org noreply at xfce.org
Sat May 18 21:02:17 CEST 2019


This is an automated email from the git hooks/post-receive script.

o   l   i   v   i   e   r       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfwm4.

commit 72ff4503e781b1e4d4f7f69ef74c5a28998e7399
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Sat May 18 20:59:17 2019 +0200

    compositor: Small optimization with zoom on GLX
    
    Not need to change clipping after painting the cursor with GLX, we don't
    use it anymore after that point.
    
    But we need to reset the fence just before painting the cursor otherwise
    the fence will be triggered too soon, causing flicker.
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/compositor.c | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index fe2e319..d8ae152 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1459,6 +1459,20 @@ fence_create (ScreenInfo *screen_info, gushort buffer)
 }
 
 static void
+fence_reset (ScreenInfo *screen_info, gushort buffer)
+{
+#ifdef HAVE_XSYNC
+    if (screen_info->fence[buffer] == None)
+    {
+        return;
+    }
+    DBG ("Reset fence for buffer %i", buffer);
+    XSyncResetFence(myScreenGetXDisplay (screen_info),
+                    screen_info->fence[buffer]);
+#endif /* HAVE_XSYNC */
+}
+
+static void
 fence_sync (ScreenInfo *screen_info, gushort buffer)
 {
 #ifdef HAVE_XSYNC
@@ -1488,8 +1502,8 @@ fence_sync (ScreenInfo *screen_info, gushort buffer)
                       screen_info->fence[buffer]);
     XSyncAwaitFence(myScreenGetXDisplay (screen_info),
                     &screen_info->fence[buffer], 1);
-    XSyncResetFence(myScreenGetXDisplay (screen_info),
-                    screen_info->fence[buffer]);
+
+    fence_reset (screen_info, buffer);
 #else
     XSync (myScreenGetXDisplay (screen_info), FALSE);
 #endif /* HAVE_XSYNC */
@@ -2279,11 +2293,10 @@ paint_all (ScreenInfo *screen_info, XserverRegion region, gushort buffer)
     {
         if (screen_info->zoomed)
         {
-            paint_cursor (screen_info, region,
-                          screen_info->rootBuffer[buffer]);
+            /* Need to reset the fence here, as we're painting some more */
+            fence_reset (screen_info, buffer);
+            paint_cursor (screen_info, region, paint_buffer);
         }
-        /* Set clipping back to the given region */
-        XFixesSetPictureClipRegion (dpy, screen_info->rootBuffer[buffer], 0, 0, region);
     }
     else
 #endif /* HAVE_EPOXY */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list