Improvement: Change generating process of alpha_pict, etc.

- Change how w->alpha_pict is generated, in hope to boost performance,
  slightly, and as a step to eventually move handling code of most resources
  used when painting to paint_preprocess().

- Remove alpha_pict parameter of shadow_picture() as it's not
  necessary.

- Let window opacity affect frame opacity.

- Rename some members of struct _win.
This commit is contained in:
Richard Grenville
2012-09-17 12:31:01 +08:00
parent 64d53f6534
commit dfde67255f
2 changed files with 59 additions and 30 deletions

View File

@ -95,8 +95,6 @@ typedef struct _win {
int damaged;
Damage damage;
Picture picture;
Picture alpha_pict;
Picture alpha_border_pict;
XserverRegion border_size;
XserverRegion extents;
Bool shadow;
@ -105,9 +103,23 @@ typedef struct _win {
int shadow_dy;
int shadow_width;
int shadow_height;
/// Current window opacity.
opacity_t opacity;
/// Opacity of current alpha_pict.
opacity_t opacity_cur;
/// Cached value of opacity window attribute.
opacity_t opacity_prop;
/// Alpha mask Picture to render window with opacity.
Picture alpha_pict;
/// Current window frame 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;
/// Whether the window is to be dimmed.
Bool dim;
wintype window_type;
@ -392,7 +404,7 @@ make_shadow(Display *dpy, double opacity,
int width, int height);
static Picture
shadow_picture(Display *dpy, double opacity, Picture alpha_pict,
shadow_picture(Display *dpy, double opacity,
int width, int height, int *wp, int *hp);
static Picture