summaryrefslogtreecommitdiff
path: root/uxa
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-03-02 07:39:41 -0800
committerCarl Worth <cworth@cworth.org>2009-03-19 10:12:06 -0700
commitb6b56f6d3710dc31bace15c0a1db1b21e0f2f20c (patch)
treeb95a618c56d3ed5798efead249c57f5459700aa6 /uxa
parent238c2c40afd9f8b61479b8640d53f20d52fd7ddf (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> (cherry picked from commit fe08b81d0f5d6f96e0124e6286bd24aba6e140ad) (also includes revert from fe08b81d0f5d6f96e0124e6286bd24aba6e140ad) (and revert from from 78a60e1b66fe2e8449702dd43d9b062d279af8f1) The reverts simply eliminate some unrelated changes accidentally included with the first commit.
Diffstat (limited to 'uxa')
-rw-r--r--uxa/uxa-glyphs.c36
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;
}