diff options
author | Keith Packard <keithp@keithp.com> | 2009-03-02 07:39:41 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-03-13 15:03:38 -0700 |
commit | fe08b81d0f5d6f96e0124e6286bd24aba6e140ad (patch) | |
tree | db47d3aa7178c441c529d1c889db6ef0614fc612 /uxa/uxa-glyphs.c | |
parent | 2026c57cf0a352d9e6f9d208cfb7d4d550614477 (diff) |
Use CopyArea to load glyphs from per-glyph pixmap to cache pixmap
With glyphs sitting in per-glyph pixmaps, there's no reason to use the CPU
to move them to the cache pixmap, and lots of reasons to use the accelerator.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'uxa/uxa-glyphs.c')
-rw-r--r-- | uxa/uxa-glyphs.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c index 5abd0015..3cb03f59 100644 --- a/uxa/uxa-glyphs.c +++ b/uxa/uxa-glyphs.c @@ -353,9 +353,7 @@ uxa_glyph_cache_hash_remove(uxa_glyph_cache_t *cache, #define CACHE_Y(pos) (cache->yOffset + ((pos) / cache->columns) * cache->glyphHeight) /* The most efficient thing to way to upload the glyph to the screen - * is to use the UploadToScreen() driver hook; this allows us to - * pipeline glyph uploads and to avoid creating offscreen pixmaps for - * glyphs that we'll never use again. + * is to use CopyArea; uxa pixmaps are always offscreen. */ static Bool uxa_glyph_cache_upload_glyph(ScreenPtr pScreen, @@ -363,37 +361,23 @@ uxa_glyph_cache_upload_glyph(ScreenPtr pScreen, int pos, GlyphPtr pGlyph) { - uxa_screen_t *uxa_screen = uxa_get_screen(pScreen); PicturePtr pGlyphPicture = GlyphPicture(pGlyph)[pScreen->myNum]; PixmapPtr pGlyphPixmap = (PixmapPtr)pGlyphPicture->pDrawable; PixmapPtr pCachePixmap = (PixmapPtr)cache->picture->pDrawable; - int cacheXoff, cacheYoff; - - if (!uxa_screen->info->put_image || uxa_screen->swappedOut) - return FALSE; - - /* If the glyph pixmap is already uploaded, no point in doing - * things this way */ - if (uxa_pixmap_is_offscreen(pGlyphPixmap)) - return FALSE; + GCPtr pGC; /* UploadToScreen only works if bpp match */ if (pGlyphPixmap->drawable.bitsPerPixel != pCachePixmap->drawable.bitsPerPixel) return FALSE; - pCachePixmap = uxa_get_offscreen_pixmap ((DrawablePtr)pCachePixmap, &cacheXoff, &cacheYoff); - if (!pCachePixmap) - return FALSE; - - if (!uxa_screen->info->put_image(pCachePixmap, - CACHE_X(pos) + cacheXoff, - CACHE_Y(pos) + cacheYoff, - pGlyph->info.width, - pGlyph->info.height, - (char *)pGlyphPixmap->devPrivate.ptr, - pGlyphPixmap->devKind)) - return FALSE; - + pGC = GetScratchGC(pCachePixmap->drawable.depth, pScreen); + ValidateGC(&pCachePixmap->drawable, pGC); + (void) uxa_copy_area (&pGlyphPixmap->drawable, + &pCachePixmap->drawable, + pGC, + 0, 0, pGlyph->info.width, pGlyph->info.height, + CACHE_X(pos), CACHE_Y(pos)); + FreeScratchGC (pGC); return TRUE; } |