exa: minor glyphs cleanup.
- This should fix subtle coordinate bugs and make the code a bit cleaner to read.
This commit is contained in:
parent
265d20068a
commit
2e88b6004f
|
@ -525,8 +525,8 @@ exaGlyphCacheBufferGlyph(ScreenPtr pScreen,
|
||||||
}
|
}
|
||||||
|
|
||||||
rect->pDst = pDst;
|
rect->pDst = pDst;
|
||||||
rect->xDst = xDst - pGlyph->info.x;
|
rect->xDst = xDst;
|
||||||
rect->yDst = yDst - pGlyph->info.y;
|
rect->yDst = yDst;
|
||||||
rect->width = pGlyph->info.width;
|
rect->width = pGlyph->info.width;
|
||||||
rect->height = pGlyph->info.height;
|
rect->height = pGlyph->info.height;
|
||||||
|
|
||||||
|
@ -603,8 +603,8 @@ exaBufferGlyph(ScreenPtr pScreen,
|
||||||
rect->ySrc = ySrc;
|
rect->ySrc = ySrc;
|
||||||
rect->xMask = xMask;
|
rect->xMask = xMask;
|
||||||
rect->yMask = yMask;
|
rect->yMask = yMask;
|
||||||
rect->xDst = xDst - pGlyph->info.x;
|
rect->xDst = xDst;
|
||||||
rect->yDst = yDst - pGlyph->info.y;
|
rect->yDst = yDst;
|
||||||
rect->width = width;
|
rect->width = width;
|
||||||
rect->height = height;
|
rect->height = height;
|
||||||
|
|
||||||
|
@ -706,7 +706,7 @@ exaGlyphs (CARD8 op,
|
||||||
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
||||||
int width = 0, height = 0;
|
int width = 0, height = 0;
|
||||||
int x, y;
|
int x, y;
|
||||||
int xDst = list->xOff, yDst = list->yOff;
|
int first_xOff = list->xOff, first_yOff = list->yOff;
|
||||||
int n;
|
int n;
|
||||||
GlyphPtr glyph;
|
GlyphPtr glyph;
|
||||||
int error;
|
int error;
|
||||||
|
@ -777,27 +777,28 @@ exaGlyphs (CARD8 op,
|
||||||
|
|
||||||
if (glyph->info.width > 0 && glyph->info.height > 0)
|
if (glyph->info.width > 0 && glyph->info.height > 0)
|
||||||
{
|
{
|
||||||
|
/* pGlyph->info.{x,y} compensate for empty space in the glyph. */
|
||||||
if (maskFormat)
|
if (maskFormat)
|
||||||
{
|
{
|
||||||
if (exaBufferGlyph(pScreen, &buffer, glyph, NULL, pMask,
|
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);
|
exaGlyphsToMask(pMask, &buffer);
|
||||||
exaBufferGlyph(pScreen, &buffer, glyph, NULL, pMask,
|
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
|
else
|
||||||
{
|
{
|
||||||
if (exaBufferGlyph(pScreen, &buffer, glyph, pSrc, pDst,
|
if (exaBufferGlyph(pScreen, &buffer, glyph, pSrc, pDst,
|
||||||
xSrc + x - xDst, ySrc + y - yDst,
|
xSrc + (x - glyph->info.x) - first_xOff, ySrc + (y - glyph->info.y) - first_yOff,
|
||||||
x, y, x + extents.x1, y + extents.y1)
|
0, 0, x - glyph->info.x, y - glyph->info.y)
|
||||||
== ExaGlyphNeedFlush)
|
== ExaGlyphNeedFlush)
|
||||||
{
|
{
|
||||||
exaGlyphsToDst(pSrc, pDst, &buffer);
|
exaGlyphsToDst(pSrc, pDst, &buffer);
|
||||||
exaBufferGlyph(pScreen, &buffer, glyph, pSrc, pDst,
|
exaBufferGlyph(pScreen, &buffer, glyph, pSrc, pDst,
|
||||||
xSrc + x - xDst, ySrc + y - yDst,
|
xSrc + (x - glyph->info.x) - first_xOff, ySrc + (y - glyph->info.y) - first_yOff,
|
||||||
x, y, x + extents.x1, y + extents.y1);
|
0, 0, x - glyph->info.x, y - glyph->info.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -823,8 +824,8 @@ exaGlyphs (CARD8 op,
|
||||||
pSrc,
|
pSrc,
|
||||||
pMask,
|
pMask,
|
||||||
pDst,
|
pDst,
|
||||||
xSrc + x - xDst,
|
xSrc + x - first_xOff,
|
||||||
ySrc + y - yDst,
|
ySrc + y - first_yOff,
|
||||||
0, 0,
|
0, 0,
|
||||||
x, y,
|
x, y,
|
||||||
width, height);
|
width, height);
|
||||||
|
|
Loading…
Reference in New Issue