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

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

commit 8803c299a64fa2d9e664e4290459cdb099ca72e0
Author: Olivier Fourdan <four...@xfce.org>
Date:   Tue May 14 23:46:41 2019 +0200

    compositor: Configurable number of buffers
    
    The number of buffers we need to allocate/manage depends on the feature
    enabled at build time.
    
    Signed-off-by: Olivier Fourdan <four...@xfce.org>
---
 src/compositor.c |  9 +++++----
 src/screen.h     | 13 ++++++++++---
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 3ba9b4b..1d6d8d2 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2447,7 +2447,8 @@ repair_screen (ScreenInfo *screen_info)
 #ifdef HAVE_PRESENT_EXTENSION
         if (screen_info->use_present)
         {
-            screen_info->current_buffer = (screen_info->current_buffer + 1) % 
2;
+            screen_info->current_buffer =
+                (screen_info->current_buffer + 1) % N_BUFFERS;
 
             if (screen_info->prevDamage)
             {
@@ -4517,7 +4518,7 @@ compositorManageScreen (ScreenInfo *screen_info)
     screen_info->transform.matrix[1][1] = 1 << 16;
     screen_info->transform.matrix[2][2] = 1 << 16;
     screen_info->zoomBuffer = None;
-    for (buffer = 0; buffer < 2; buffer++)
+    for (buffer = 0; buffer < N_BUFFERS; buffer++)
     {
         screen_info->rootPixmap[buffer] = None;
         screen_info->rootBuffer[buffer] = None;
@@ -4650,7 +4651,7 @@ compositorUnmanageScreen (ScreenInfo *screen_info)
     free_glx_data (screen_info);
 #endif /* HAVE_EPOXY */
 
-    for (buffer = 0; buffer < 2; buffer++)
+    for (buffer = 0; buffer < N_BUFFERS; buffer++)
     {
         if (screen_info->rootPixmap[buffer])
         {
@@ -4840,7 +4841,7 @@ compositorUpdateScreenSize (ScreenInfo *screen_info)
     }
 #endif /* HAVE_EPOXY */
 
-    for (buffer = 0; buffer < 2; buffer++)
+    for (buffer = 0; buffer < N_BUFFERS; buffer++)
     {
         if (screen_info->rootPixmap[buffer])
         {
diff --git a/src/screen.h b/src/screen.h
index 0370ed6..1496325 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -63,6 +63,13 @@
 
 
 #ifdef HAVE_COMPOSITOR
+
+#ifdef HAVE_PRESENT_EXTENSION
+#define N_BUFFERS 2
+#else
+#define N_BUFFERS 1
+#endif /* HAVE_PRESENT_EXTENSION */
+
 struct _gaussian_conv {
     int     size;
     double  *data;
@@ -184,8 +191,8 @@ struct _ScreenInfo
     guchar *shadowTop;
 
     gushort current_buffer;
-    Pixmap rootPixmap[2];
-    Picture rootBuffer[2];
+    Pixmap rootPixmap[N_BUFFERS];
+    Picture rootBuffer[N_BUFFERS];
     Picture zoomBuffer;
     Picture rootPicture;
     Picture blackPicture;
@@ -227,7 +234,7 @@ struct _ScreenInfo
     GLXContext glx_context;
     GLXWindow glx_window;
 #ifdef HAVE_XSYNC
-    XSyncFence fence[2];
+    XSyncFence fence[N_BUFFERS];
 #endif /* HAVE_XSYNC */
 #endif /* HAVE_EPOXY */
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to