summaryrefslogtreecommitdiff
path: root/exa/exa_glyphs.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2008-04-28 21:09:35 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2008-04-28 21:09:35 +0200
commit8349732a6720652bfbad7874a952be73a0e8e77b (patch)
tree07272e4c05fb5f22b1940813bfa53a4565542e8e /exa/exa_glyphs.c
parenta65d530040bb561ba88c5d8c71633a7c0bf11e89 (diff)
EXA: Try to accelerate non-antialiased text via the glyph cache as well.
Treat 1 bit glyphs and masks as PICT_a8 in the glyph cache. We're not able to accelerate them otherwise.
Diffstat (limited to 'exa/exa_glyphs.c')
-rw-r--r--exa/exa_glyphs.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c
index 08ec09780..ff665d555 100644
--- a/exa/exa_glyphs.c
+++ b/exa/exa_glyphs.c
@@ -374,6 +374,10 @@ exaGlyphCacheUploadGlyph(ScreenPtr pScreen,
if (exaPixmapIsOffscreen(pGlyphPixmap))
return FALSE;
+ /* UploadToScreen only works if bpp match */
+ if (pGlyphPixmap->drawable.bitsPerPixel != pCachePixmap->drawable.bitsPerPixel)
+ return FALSE;
+
/* cache pixmap must be offscreen. */
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = FALSE;
@@ -524,6 +528,9 @@ exaBufferGlyph(ScreenPtr pScreen,
if (buffer->count == GLYPH_BUFFER_SIZE)
return ExaGlyphNeedFlush;
+
+ if (PICT_FORMAT_BPP(format) == 1)
+ format = PICT_a8;
for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) {
ExaGlyphCachePtr cache = &pExaScr->glyphCaches[i];
@@ -796,6 +803,14 @@ exaGlyphs (CARD8 op,
return;
width = extents.x2 - extents.x1;
height = extents.y2 - extents.y1;
+
+ if (maskFormat->depth == 1) {
+ PictFormatPtr a8Format = PictureMatchFormat (pScreen, 8, PICT_a8);
+
+ if (a8Format)
+ maskFormat = a8Format;
+ }
+
pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
maskFormat->depth,
CREATE_PIXMAP_USAGE_SCRATCH);