[beryl-commits] compiz mirror: Changes to 'master' (590d7d94aa61caa9222e9ceb0d12b78344db47a5)

compiz at server.beryl-project.org compiz at server.beryl-project.org
Fri Jun 1 20:04:11 CEST 2007


New commits:
commit 590d7d94aa61caa9222e9ceb0d12b78344db47a5
Merge: 857776f1c033628717ef69a911d095505d50868d 0e01bec891a6e5d1ed6293f003c34e0ee97f9b22
Author: David Reveman <davidr at novell.com>
Date:   Fri Jun 1 13:57:22 2007 -0400

    Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/app/compiz

commit 857776f1c033628717ef69a911d095505d50868d
Author: David Reveman <davidr at novell.com>
Date:   Fri Jun 1 13:47:06 2007 -0400

    Bump ABIVERSION.

commit 83291057e31b13c7eb396b2cf5445d5d0a00e8f4
Author: David Reveman <davidr at novell.com>
Date:   Fri Jun 1 12:27:52 2007 -0400

    Use new walk interface.

commit f933ada81fa0a58911a8cb7d973a392a5ba3a2e9
Author: David Reveman <davidr at novell.com>
Date:   Fri Jun 1 12:21:31 2007 -0400

    Add CompWalker interface.


 include/compiz.h |   24 +++++++++++++++++++++++-
 src/paint.c      |   10 ++++++++--
 src/screen.c     |   37 +++++++++++++++++++++++++++++++++++++
 3 files changed, 68 insertions(+), 3 deletions(-)


Modified: compiz/include/compiz.h
===================================================================
--- compiz/include/compiz.h
+++ compiz/include/compiz.h
@@ -26,7 +26,7 @@
 #ifndef _COMPIZ_H
 #define _COMPIZ_H
 
-#define ABIVERSION 20070602
+#define ABIVERSION 20070603
 
 #include <stdio.h>
 #include <sys/time.h>
@@ -90,6 +90,7 @@ typedef struct _CompCursor	  CompCursor;
 typedef struct _CompMatch	  CompMatch;
 typedef struct _CompMetadata      CompMetadata;
 typedef struct _CompOutput        CompOutput;
+typedef struct _CompWalker        CompWalker;
 
 /* virtual modifiers */
 
@@ -1235,6 +1236,22 @@ typedef void (*ApplyScreenTransformProc) (CompScreen		  *screen,
 					  CompOutput		  *output,
 					  CompTransform	          *transform);
 
+typedef void (*WalkerFiniProc) (CompScreen *screen,
+				CompWalker *walker);
+
+typedef CompWindow *(*WalkInitProc) (CompScreen *screen);
+typedef CompWindow *(*WalkStepProc) (CompWindow *window);
+
+struct _CompWalker {
+    WalkerFiniProc fini;
+    CompPrivate	   priv;
+
+    WalkInitProc first;
+    WalkInitProc last;
+    WalkStepProc next;
+    WalkStepProc prev;
+};
+
 /*
   window paint flags
 
@@ -1710,6 +1727,9 @@ typedef void (*WindowAddNotifyProc) (CompWindow *window);
 
 typedef void (*OutputChangeNotifyProc) (CompScreen *screen);
 
+typedef void (*InitWindowWalkerProc) (CompScreen *screen,
+				      CompWalker *walker);
+
 #define COMP_SCREEN_DAMAGE_PENDING_MASK (1 << 0)
 #define COMP_SCREEN_DAMAGE_REGION_MASK  (1 << 1)
 #define COMP_SCREEN_DAMAGE_ALL_MASK     (1 << 2)
@@ -2022,6 +2042,8 @@ struct _CompScreen {
 
     OutputChangeNotifyProc outputChangeNotify;
 
+    InitWindowWalkerProc initWindowWalker;
+
     CompPrivate *privates;
 };
 

Modified: compiz/src/paint.c
===================================================================
--- compiz/src/paint.c
+++ compiz/src/paint.c
@@ -161,6 +161,7 @@ paintOutputRegion (CompScreen	       *screen,
     CompCursor	  *c;
     int		  count, windowMask, backgroundMask;
     CompWindow	  *fullscreenWindow = NULL;
+    CompWalker    walk;
 
     if (!tmpRegion)
     {
@@ -184,8 +185,10 @@ paintOutputRegion (CompScreen	       *screen,
 
     XSubtractRegion (region, &emptyRegion, tmpRegion);
 
+    (*screen->initWindowWalker) (screen, &walk);
+
     /* detect occlusions */
-    for (w = screen->reverseWindows; w; w = w->prev)
+    for (w = (*walk.last) (screen); w; w = (*walk.prev) (w))
     {
 	if (w->destroyed)
 	    continue;
@@ -221,7 +224,7 @@ paintOutputRegion (CompScreen	       *screen,
     (*screen->paintBackground) (screen, tmpRegion, backgroundMask);
 
     /* paint all windows from bottom to top */
-    for (w = screen->windows; w; w = w->next)
+    for (w = (*walk.first) (screen); w; w = (*walk.next) (w))
     {
 	if (w->destroyed)
 	    continue;
@@ -238,6 +241,9 @@ paintOutputRegion (CompScreen	       *screen,
 	(*screen->paintWindow) (w, &w->paint, transform, w->clip, windowMask);
     }
 
+    if (walk.fini)
+	(*walk.fini) (screen, &walk);
+
     /* paint cursors */
     for (c = screen->cursors; c; c = c->next)
 	(*screen->paintCursor) (c, transform, tmpRegion, 0);

Modified: compiz/src/screen.c
===================================================================
--- compiz/src/screen.c
+++ compiz/src/screen.c
@@ -1359,6 +1359,41 @@ leaveShowDesktopMode (CompScreen *s,
 		     (unsigned char *) &data, 1);
 }
 
+static CompWindow *
+walkFirst (CompScreen *s)
+{
+    return s->windows;
+}
+
+static CompWindow *
+walkLast (CompScreen *s)
+{
+    return s->reverseWindows;
+}
+
+static CompWindow *
+walkNext (CompWindow *w)
+{
+    return w->next;
+}
+
+static CompWindow *
+walkPrev (CompWindow *w)
+{
+    return w->prev;
+}
+
+static void
+initWindowWalker (CompScreen *screen,
+		  CompWalker *walker)
+{
+    walker->fini  = NULL;
+    walker->first = walkFirst;
+    walker->last  = walkLast;
+    walker->next  = walkNext;
+    walker->prev  = walkPrev;
+}
+
 Bool
 addScreen (CompDisplay *display,
 	   int	       screenNum,
@@ -1554,6 +1589,8 @@ addScreen (CompDisplay *display,
 
     s->outputChangeNotify = outputChangeNotify;
 
+    s->initWindowWalker = initWindowWalker;
+
     s->getProcAddress = 0;
 
     if (!XGetWindowAttributes (dpy, s->root, &s->attrib))



More information about the commits mailing list