optimization: Render on pixmaps and copy the result on Stack_Wins

This should speed up the rendering of Stack_Wins with many window
decorations and it should considerably reduce flicker.
This commit is contained in:
Michael Stapelberg
2009-07-17 18:32:40 +02:00
parent 0434b6ea3d
commit 5b51c8c6f0
7 changed files with 80 additions and 7 deletions

@ -101,6 +101,22 @@ struct Colorpixel {
SLIST_ENTRY(Colorpixel) colorpixels;
};
struct Cached_Pixmap {
xcb_pixmap_t id;
/* Were going to paint on it, so a graphics context will be needed */
xcb_gcontext_t gc;
/* The rect with which the pixmap was created */
Rect rect;
/* The rect of the object to which this pixmap belongs. Necessary to
* find out when we need to re-create the pixmap. */
Rect *referred_rect;
xcb_drawable_t referred_drawable;
};
/**
* Contains data for the windows needed to draw the titlebars on in stacking
* mode
@ -108,7 +124,7 @@ struct Colorpixel {
*/
struct Stack_Window {
xcb_window_t window;
xcb_gcontext_t gc;
struct Cached_Pixmap pixmap;
Rect rect;
/** Backpointer to the container this stack window is in */