diff options
author | Richard Grenville <pyxlcy@gmail.com> | 2012-09-29 13:15:09 +0800 |
---|---|---|
committer | Richard Grenville <pyxlcy@gmail.com> | 2012-09-29 13:21:39 +0800 |
commit | 83f64a227567dfd6ec6c7d60d3bd095cfb9bd93d (patch) | |
tree | 5ef1626c86b7e6226988e2114e7b08a13014eb79 /compton.h | |
parent | debc0035cd5cc315e6fe5941e9b36e1eb3548f5f (diff) | |
download | tdebase-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.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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. |