[Xfce4-commits] [xfce/xfwm4] 02/03: compositor: Prefer GL over Present

noreply at xfce.org noreply at xfce.org
Mon Apr 27 21:54:47 CEST 2015


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

olivier pushed a commit to branch master
in repository xfce/xfwm4.

commit aee242cec4c3d8e8232d67875ec9fbfbeb504a9d
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Mon Apr 27 21:40:27 2015 +0200

    compositor: Prefer GL over Present
    
    If both are available, try to use GL first and next Present.
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/compositor.c |   58 +++++++++++++++++++++++++-----------------------------
 1 file changed, 27 insertions(+), 31 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index aef80b5..3e74571 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2017,8 +2017,22 @@ paint_all (ScreenInfo *screen_info, XserverRegion region, gushort buffer)
         }
     }
 
+#ifdef HAVE_EPOXY
+    if (screen_info->use_glx) /* glx first if available */
+    {
+        XFlush (dpy);
+        if (vblank_enabled (screen_info))
+        {
+            wait_glx_vblank (screen_info);
+        }
+        bind_glx_texture (screen_info,
+                          screen_info->rootPixmap[buffer]);
+        redraw_glx_texture (screen_info);
+    }
+    else
+#endif /* HAVE_EPOXY */
 #ifdef HAVE_PRESENT_EXTENSION
-    if (screen_info->use_present) /* present first if available */
+    if (screen_info->use_present) /* otherwise present if available */
     {
         if (screen_info->zoomed)
         {
@@ -2033,20 +2047,6 @@ paint_all (ScreenInfo *screen_info, XserverRegion region, gushort buffer)
     }
     else
 #endif /* HAVE_PRESENT_EXTENSION */
-#ifdef HAVE_EPOXY
-    if (screen_info->use_glx) /* then glx if available */
-    {
-        XFlush (dpy);
-        if (vblank_enabled (screen_info))
-        {
-            wait_glx_vblank (screen_info);
-        }
-        bind_glx_texture (screen_info,
-                          screen_info->rootPixmap[buffer]);
-        redraw_glx_texture (screen_info);
-    }
-    else
-#endif /* HAVE_EPOXY */
     {
         if (screen_info->zoomed)
         {
@@ -4149,9 +4149,20 @@ compositorManageScreen (ScreenInfo *screen_info)
     XClearArea (display_info->dpy, screen_info->output, 0, 0, 0, 0, TRUE);
     TRACE ("Manual compositing enabled");
 
+#ifdef HAVE_EPOXY
+    screen_info->glx_context = None;
+    screen_info->glx_window = None;
+    screen_info->rootTexture = None;
+    screen_info->glx_drawable = None;
+    screen_info->texture_filter = GL_LINEAR;
+    screen_info->use_glx = init_glx (screen_info);
+#else /* HAVE_EPOXY */
+    screen_info->use_glx = FALSE;
+#endif /* HAVE_EPOXY */
+
 #ifdef HAVE_PRESENT_EXTENSION
     /* Prefer present over glx if available (it's faster on my hardware) */
-    screen_info->use_present = display_info->have_present;
+    screen_info->use_present = display_info->have_present && !screen_info->use_glx;
     if (screen_info->use_present)
     {
         screen_info->present_pending = FALSE;
@@ -4163,21 +4174,6 @@ compositorManageScreen (ScreenInfo *screen_info)
     screen_info->use_present = FALSE;
 #endif /* HAVE_PRESENT_EXTENSION */
 
-#ifdef HAVE_EPOXY
-    screen_info->use_glx = !screen_info->use_present;
-    if (screen_info->use_glx)
-    {
-        screen_info->glx_context = None;
-        screen_info->glx_window = None;
-        screen_info->rootTexture = None;
-        screen_info->glx_drawable = None;
-        screen_info->texture_filter = GL_LINEAR;
-        screen_info->use_glx = init_glx (screen_info);
-    }
-#else /* HAVE_EPOXY */
-    screen_info->use_glx = FALSE;
-#endif /* HAVE_EPOXY */
-
     XFixesSelectCursorInput (display_info->dpy,
                              screen_info->xroot,
                              XFixesDisplayCursorNotifyMask);

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


More information about the Xfce4-commits mailing list