diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-12-07 21:27:56 +0000 |
---|---|---|
committer | Owain G. Ainsworth <oga@openbsd.org> | 2010-03-01 19:13:19 +0000 |
commit | f1463fdbdb0313bf5df27b4309c1a600fa3bec2f (patch) | |
tree | 9bc07a4f058601b7687c9326830c04a02a3bc4a0 /uxa/uxa.c | |
parent | 297a623e8cb70efcec68ac136dae0994c88f84cb (diff) |
uxa: Cache solid fills.
Maintain a small cache of pixmaps to hold SolidFill pictures. Currently
we create a pixmap the size of the damaged region and fill that using
pixman before downloading it to the GPU and compositing. Needless to say
this is extremely expensive compared to simply emitting the solid
colour. To mitigate this cost, we maintain a small cache of 1x1R
pictures which is recognised by the driver as being a solid, but at the
very least is maintained as a GPU ready pixmap.
This gives a good boost to cairo-xcb (which uses solid fills) on a gm45:
Before:
gnome-terminal-vim: 41.9s
After:
gnome-terminal-vim: 31.7s
Compare with using a cache of 1x1R pixmaps in cairo-xcb:
gnome-terminal-vim: 31.6s
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit c1afc831c8fe4cbececee7dfa23506a6746c2425)
Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
Diffstat (limited to 'uxa/uxa.c')
-rw-r--r-- | uxa/uxa.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -361,6 +361,16 @@ static Bool uxa_close_screen(int i, ScreenPtr pScreen) #ifdef RENDER PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); #endif + int n; + + if (uxa_screen->solid_clear) + FreePicture(uxa_screen->solid_clear, 0); + if (uxa_screen->solid_black) + FreePicture(uxa_screen->solid_black, 0); + if (uxa_screen->solid_white) + FreePicture(uxa_screen->solid_white, 0); + for (n = 0; n < uxa_screen->solid_cache_size; n++) + FreePicture(uxa_screen->solid_cache[n].picture, 0); uxa_glyphs_fini(pScreen); @@ -467,6 +477,11 @@ Bool uxa_driver_init(ScreenPtr screen, uxa_driver_t * uxa_driver) dixSetPrivate(&screen->devPrivates, &uxa_screen_index, uxa_screen); + uxa_screen->solid_cache_size = 0; + uxa_screen->solid_clear = 0; + uxa_screen->solid_black = 0; + uxa_screen->solid_white = 0; + // exaDDXDriverInit(screen); /* |