summaryrefslogtreecommitdiffstats
path: root/compton.h
diff options
context:
space:
mode:
authorRichard Grenville <pyxlcy@gmail.com>2012-09-29 13:15:09 +0800
committerRichard Grenville <pyxlcy@gmail.com>2012-09-29 13:21:39 +0800
commit83f64a227567dfd6ec6c7d60d3bd095cfb9bd93d (patch)
tree5ef1626c86b7e6226988e2114e7b08a13014eb79 /compton.h
parentdebc0035cd5cc315e6fe5941e9b36e1eb3548f5f (diff)
downloadtdebase-83f64a227567dfd6ec6c7d60d3bd095cfb9bd93d.tar.gz
tdebase-83f64a227567dfd6ec6c7d60d3bd095cfb9bd93d.zip
Improvement: Split shadow_pict to shadow_pict & shadow_alpha_pict
Split w->shadow_pict to w->shadow_pict and w->shadow_alpha_pict, so that the whole w->shadow_pict need not to be rebuild on shadow opacity change. This greatly reduces CPU usage of compton when a window with shadow is fading. (My test shows the CPU usage of compton process dropped from 1.15% to 0.35% when constantly fading in and out a window.) It uses a rather painful and slow method in shadow_picture() to get around the limitation of PictStandardA8 to make colored shadows work. I wonder if there's a better approach. - Merge variables gsize and cgsize as they seemingly represent the same thing.
Diffstat (limited to 'compton.h')
-rw-r--r--compton.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/compton.h b/compton.h
index 51118e8db..f3c32365d 100644
--- a/compton.h
+++ b/compton.h
@@ -228,9 +228,10 @@ typedef struct _win {
int shadow_width;
/// Height of shadow. Affected by window size and commandline argument.
int shadow_height;
- /// Alpha mask Picture to render shadow. Affected by window size and
- /// shadow opacity.
+ /// Picture to render shadow. Affected by window size.
Picture shadow_pict;
+ /// Alpha mask Picture to render shadow. Affected by shadow opacity.
+ Picture shadow_alpha_pict;
// Dim-related members
/// Whether the window is to be dimmed.