diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-12-07 21:27:56 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-12-07 21:37:31 +0000 |
commit | c1afc831c8fe4cbececee7dfa23506a6746c2425 (patch) | |
tree | d15f586c68af3150aa6c09a45954daba9d88521d /uxa/uxa.c | |
parent | cd475bad23c02130d11c49882c11261c9f0d4ef1 (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>
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); /* |