summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-05-10 09:21:05 +0200
committerDanny Baumann <dannybaumann@web.de>2008-05-10 09:21:05 +0200
commit841a67972de595fb21f67313b555c451fe9802e5 (patch)
tree580ed4ab189672f4e6edf821b2faa181c54e91a4
parent8e01131f14b0ce3687c98da7770fdaa8991e2c9b (diff)
downloadbs-841a67972de595fb21f67313b555c451fe9802e5.tar.gz
bs-841a67972de595fb21f67313b555c451fe9802e5.tar.bz2
Optimization.
-rw-r--r--bs.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/bs.c b/bs.c
index c66a4e4..3031682 100644
--- a/bs.c
+++ b/bs.c
@@ -406,22 +406,30 @@ BSPaintWindow (CompWindow *w,
Region region,
unsigned int mask)
{
- Bool status;
+ Bool status;
+ CompScreen *s = w->screen;
- BS_SCREEN (w->screen);
+ BS_SCREEN (s);
BS_WINDOW (w);
- WindowPaintAttrib wAttrib = *attrib;
-
- if (w->paint.saturation != bw->saturation)
- wAttrib.saturation = bw->saturation;
+ if (attrib->brightness != bw->brightness ||
+ attrib->saturation != bw->saturation)
+ {
+ WindowPaintAttrib wAttrib = *attrib;
- if (w->paint.brightness != bw->brightness)
wAttrib.brightness = bw->brightness;
+ wAttrib.saturation = bw->saturation;
- UNWRAP (bs, w->screen, paintWindow);
- status = (*w->screen->paintWindow) (w, &wAttrib, transform, region, mask);
- WRAP (bs, w->screen, paintWindow, BSPaintWindow);
+ UNWRAP (bs, s, paintWindow);
+ status = (*s->paintWindow) (w, &wAttrib, transform, region, mask);
+ WRAP (bs, s, paintWindow, BSPaintWindow);
+ }
+ else
+ {
+ UNWRAP (bs, s, paintWindow);
+ status = (*s->paintWindow) (w, attrib, transform, region, mask);
+ WRAP (bs, s, paintWindow, BSPaintWindow);
+ }
return status;
}