diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-11-29 20:53:35 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-11-29 20:55:33 +0000 |
commit | 2c3aee2b570dadd9270a08d8ff675d07ac405e33 (patch) | |
tree | 37957c5c6cd41419cc0d2428d7ac238210cdb294 /uxa | |
parent | 646b4a9483c01509a7324cc05eaadb72bc940c6d (diff) |
uxa-glyphs: Stream uploads via temporary bo
Avoid mapping the glyph cache back to the cpu by allocating temporary
buffer objects to store the glyph pixmap and blit to the cache.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'uxa')
-rw-r--r-- | uxa/uxa-glyphs.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c index 5901552e..ff167812 100644 --- a/uxa/uxa-glyphs.c +++ b/uxa/uxa-glyphs.c @@ -363,6 +363,7 @@ uxa_glyph_cache_upload_glyph(ScreenPtr pScreen, PicturePtr pGlyphPicture = GlyphPicture(pGlyph)[pScreen->myNum]; PixmapPtr pGlyphPixmap = (PixmapPtr) pGlyphPicture->pDrawable; PixmapPtr pCachePixmap = (PixmapPtr) cache->picture->pDrawable; + PixmapPtr scratch; GCPtr pGC; /* UploadToScreen only works if bpp match */ @@ -372,12 +373,35 @@ uxa_glyph_cache_upload_glyph(ScreenPtr pScreen, pGC = GetScratchGC(pCachePixmap->drawable.depth, pScreen); ValidateGC(&pCachePixmap->drawable, pGC); - (void)uxa_copy_area(&pGlyphPixmap->drawable, + + /* Create a temporary bo to stream the updates to the cache */ + scratch = (*pScreen->CreatePixmap)(pScreen, + pGlyph->info.width, + pGlyph->info.height, + pGlyphPixmap->drawable.depth, + UXA_CREATE_PIXMAP_FOR_MAP); + if (scratch) { + (void)uxa_copy_area(&pGlyphPixmap->drawable, + &scratch->drawable, + pGC, + 0, 0, + pGlyph->info.width, pGlyph->info.height, + 0, 0); + } else { + scratch = pGlyphPixmap; + } + + (void)uxa_copy_area(&scratch->drawable, &pCachePixmap->drawable, pGC, 0, 0, pGlyph->info.width, pGlyph->info.height, CACHE_X(pos), CACHE_Y(pos)); + + if (scratch != pGlyphPixmap) + (*pScreen->DestroyPixmap)(scratch); + FreeScratchGC(pGC); + return TRUE; } |