From 2b120a74844d94d9f06fb86692fb667e557bc613 Mon Sep 17 00:00:00 2001 From: Richard Grenville Date: Sat, 13 Oct 2012 18:46:59 +0800 Subject: Improvement: Pregenerate alpha pictures Pregenerate alpha pictures to save time when painting. Add --alpha-step to control the step of alpha picture generation (the opacity difference between two consecutively generated alpha pictures). --- compton.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'compton.h') diff --git a/compton.h b/compton.h index d28018b73..56a397668 100644 --- a/compton.h +++ b/compton.h @@ -221,8 +221,6 @@ typedef struct _win { opacity_t opacity; /// Target window opacity. opacity_t opacity_tgt; - /// Opacity of current alpha_pict. - opacity_t opacity_cur; /// Cached value of opacity window attribute. opacity_t opacity_prop; /// Cached value of opacity window attribute on client window. For @@ -244,8 +242,6 @@ typedef struct _win { // Frame-opacity-related members /// Current window frame opacity. Affected by window opacity. double frame_opacity; - /// Opacity of current frame_alpha_pict. - opacity_t frame_opacity_cur; /// Alpha mask Picture to render window frame with opacity. Picture frame_alpha_pict; /// Frame widths. Determined by client window attributes. @@ -256,8 +252,6 @@ typedef struct _win { Bool shadow; /// Opacity of the shadow. Affected by window opacity and frame opacity. double shadow_opacity; - /// Opacity of current shadow_pict. - double shadow_opacity_cur; /// X offset of shadow. Affected by commandline argument. int shadow_dx; /// Y offset of shadow. Affected by commandline argument. @@ -359,6 +353,8 @@ typedef struct _options { Bool detect_client_opacity; /// How much to dim an inactive window. 0.0 - 1.0, 0 to disable. double inactive_dim; + /// Step for pregenerating alpha pictures. 0.01 - 1.0. + double alpha_step; // Calculated /// Whether compton needs to track focus changes. @@ -1125,3 +1121,6 @@ vsync_opengl_wait(void); static Bool vsync_wait(Display *dpy, struct pollfd *fd, int timeout); + +static void +init_alpha_picts(Display *dpy); -- cgit v1.2.1