summaryrefslogtreecommitdiff
path: root/src/paint.cpp
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@compiz-fusion.org>2008-08-20 19:32:45 +0200
committerDennis kasprzyk <onestone@compiz-fusion.org>2008-08-20 19:32:45 +0200
commit01b0aa33dfe61e00adfa390e2fc36087e3c9ab2e (patch)
tree49034803abaefdad2c885bda4c0c330065f5322f /src/paint.cpp
parent5c7a3b43ea2f387754d182a2eb6b64cad918ed16 (diff)
downloadzcomp-01b0aa33dfe61e00adfa390e2fc36087e3c9ab2e.tar.gz
zcomp-01b0aa33dfe61e00adfa390e2fc36087e3c9ab2e.tar.bz2
Store Windows in a STL list.
Diffstat (limited to 'src/paint.cpp')
-rw-r--r--src/paint.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/paint.cpp b/src/paint.cpp
index 72293a2..c2e6f4e 100644
--- a/src/paint.cpp
+++ b/src/paint.cpp
@@ -27,6 +27,9 @@
#include <string.h>
#include <math.h>
+#include <boost/foreach.hpp>
+#define foreach BOOST_FOREACH
+
#include <compiz-core.h>
#include "privatescreen.h"
@@ -174,13 +177,15 @@ PrivateScreen::paintOutputRegion (const CompTransform *transform,
CompWindow *w;
int count, windowMask, odMask;
CompWindow *fullscreenWindow = NULL;
- CompWalker walk;
bool status;
bool withOffset = false;
CompTransform vTransform;
int offX, offY;
Region clip = region;
+ CompWindowList pl;
+ CompWindowList::reverse_iterator rit;
+
if (!tmpRegion)
{
tmpRegion = XCreateRegion ();
@@ -201,13 +206,15 @@ PrivateScreen::paintOutputRegion (const CompTransform *transform,
XSubtractRegion (region, &emptyRegion, tmpRegion);
- screen->initWindowWalker (&walk);
+ pl = screen->getWindowPaintList ();
if (!(mask & PAINT_SCREEN_NO_OCCLUSION_DETECTION_MASK))
{
/* detect occlusions */
- for (w = (*walk.last) (screen); w; w = (*walk.prev) (w))
+ for (rit = pl.rbegin (); rit != pl.rend(); rit++)
{
+ w = (*rit);
+
if (w->destroyed ())
continue;
@@ -288,7 +295,7 @@ PrivateScreen::paintOutputRegion (const CompTransform *transform,
paintBackground (tmpRegion, (mask & PAINT_SCREEN_TRANSFORMED_MASK));
/* paint all windows from bottom to top */
- for (w = (*walk.first) (screen); w; w = (*walk.next) (w))
+ foreach (w, pl)
{
if (w->destroyed ())
continue;
@@ -322,9 +329,6 @@ PrivateScreen::paintOutputRegion (const CompTransform *transform,
w->paint (&w->paintAttrib (), transform, clip, windowMask);
}
}
-
- if (walk.fini)
- (*walk.fini) (screen, &walk);
}
void