diff options
author | Maarten Maathuis <madman2003@gmail.com> | 2009-02-26 21:14:23 +0100 |
---|---|---|
committer | Maarten Maathuis <madman2003@gmail.com> | 2009-02-27 16:58:30 +0100 |
commit | 2e88b6004f09dbcb888abf05d4d5554231b2bd1a (patch) | |
tree | 2f7eabb947d8b241b87ba4831a2427d5af01fecf /exa | |
parent | 265d20068af5434489752b6dba0bf0065b3cc3ec (diff) |
exa: minor glyphs cleanup.
- This should fix subtle coordinate bugs and make the code a bit cleaner to read.
Diffstat (limited to 'exa')
-rw-r--r-- | exa/exa_glyphs.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c index d55839c8d..1480bc2f1 100644 --- a/exa/exa_glyphs.c +++ b/exa/exa_glyphs.c @@ -525,8 +525,8 @@ exaGlyphCacheBufferGlyph(ScreenPtr pScreen, } rect->pDst = pDst; - rect->xDst = xDst - pGlyph->info.x; - rect->yDst = yDst - pGlyph->info.y; + rect->xDst = xDst; + rect->yDst = yDst; rect->width = pGlyph->info.width; rect->height = pGlyph->info.height; @@ -603,8 +603,8 @@ exaBufferGlyph(ScreenPtr pScreen, rect->ySrc = ySrc; rect->xMask = xMask; rect->yMask = yMask; - rect->xDst = xDst - pGlyph->info.x; - rect->yDst = yDst - pGlyph->info.y; + rect->xDst = xDst; + rect->yDst = yDst; rect->width = width; rect->height = height; @@ -706,7 +706,7 @@ exaGlyphs (CARD8 op, ScreenPtr pScreen = pDst->pDrawable->pScreen; int width = 0, height = 0; int x, y; - int xDst = list->xOff, yDst = list->yOff; + int first_xOff = list->xOff, first_yOff = list->yOff; int n; GlyphPtr glyph; int error; @@ -777,27 +777,28 @@ exaGlyphs (CARD8 op, if (glyph->info.width > 0 && glyph->info.height > 0) { + /* pGlyph->info.{x,y} compensate for empty space in the glyph. */ if (maskFormat) { if (exaBufferGlyph(pScreen, &buffer, glyph, NULL, pMask, - 0, 0, 0, 0, x, y) == ExaGlyphNeedFlush) + 0, 0, 0, 0, x - glyph->info.x, y - glyph->info.y) == ExaGlyphNeedFlush) { exaGlyphsToMask(pMask, &buffer); exaBufferGlyph(pScreen, &buffer, glyph, NULL, pMask, - 0, 0, 0, 0, x, y); + 0, 0, 0, 0, x - glyph->info.x, y - glyph->info.y); } } else { if (exaBufferGlyph(pScreen, &buffer, glyph, pSrc, pDst, - xSrc + x - xDst, ySrc + y - yDst, - x, y, x + extents.x1, y + extents.y1) + xSrc + (x - glyph->info.x) - first_xOff, ySrc + (y - glyph->info.y) - first_yOff, + 0, 0, x - glyph->info.x, y - glyph->info.y) == ExaGlyphNeedFlush) { exaGlyphsToDst(pSrc, pDst, &buffer); exaBufferGlyph(pScreen, &buffer, glyph, pSrc, pDst, - xSrc + x - xDst, ySrc + y - yDst, - x, y, x + extents.x1, y + extents.y1); + xSrc + (x - glyph->info.x) - first_xOff, ySrc + (y - glyph->info.y) - first_yOff, + 0, 0, x - glyph->info.x, y - glyph->info.y); } } } @@ -823,8 +824,8 @@ exaGlyphs (CARD8 op, pSrc, pMask, pDst, - xSrc + x - xDst, - ySrc + y - yDst, + xSrc + x - first_xOff, + ySrc + y - first_yOff, 0, 0, x, y, width, height); |