summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Young <rcxdude@gmail.com>2008-06-24 17:20:05 +0100
committerDouglas Young <rcxdude@gmail.com>2008-06-24 17:20:05 +0100
commit7782233ab074be000612df1310f5a003c7bc22bd (patch)
treee8f7be67e71637fcbb338bb7587fc2620d305ac3
parentd95b3a112a06db1334bb21276ac885e860e305a2 (diff)
downloaddialog-7782233ab074be000612df1310f5a003c7bc22bd.tar.gz
dialog-7782233ab074be000612df1310f5a003c7bc22bd.tar.bz2
avoid copying structures when it isn't needed
-rw-r--r--dialog.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/dialog.c b/dialog.c
index 2b365a1..daaeda5 100644
--- a/dialog.c
+++ b/dialog.c
@@ -99,15 +99,22 @@ dialogPaintWindow (CompWindow *w,
DIALOG_SCREEN(w->screen);
DIALOG_WINDOW(w);
int status;
- WindowPaintAttrib wAttrib = *attrib;
- wAttrib.opacity *= dw->opacity/100;
- wAttrib.saturation *= dw->saturation/100;
- wAttrib.brightness *= dw->brightness/100;
- if (dw->animate)
- addWindowDamage (w);
- UNWRAP(ds,w->screen, paintWindow);
- status = (*w->screen->paintWindow)(w, &wAttrib, transform, region, mask);
- WRAP(ds, w->screen, paintWindow, dialogPaintWindow);
+ if (dw->faded || dw->animate)
+ {
+ WindowPaintAttrib wAttrib = *attrib;
+ wAttrib.opacity *= dw->opacity/100;
+ wAttrib.saturation *= dw->saturation/100;
+ wAttrib.brightness *= dw->brightness/100;
+ if (dw->animate)
+ addWindowDamage (w);
+ UNWRAP(ds,w->screen, paintWindow);
+ status = (*w->screen->paintWindow)(w, &wAttrib, transform, region, mask);
+ WRAP(ds, w->screen, paintWindow, dialogPaintWindow);
+ } else {
+ UNWRAP(ds,w->screen, paintWindow);
+ status = (*w->screen->paintWindow)(w, attrib, transform, region, mask);
+ WRAP(ds, w->screen, paintWindow, dialogPaintWindow);
+ }
return status;
}