glamor: store old fonts in double width textures.

There is a problem with some fonts that the height necessary
to store the font is greater than the max texture size, which
causes a fallback to occur. We can avoid this by storing two
macro columns side-by-side in the texture and adjusting
the calculations to suit.

This fixes
xfd -fn -*-*-*-*-*-*-*-*-*-*-*-*-*-*
falling back here, when it picks
-arabic-newspaper-medium-r-normal--32-246-100-100-p-137-iso10646-1

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie 2016-01-12 14:19:24 +10:00
commit 8116fd8a76
3 changed files with 29 additions and 8 deletions

View file

@ -142,7 +142,7 @@ glamor_text(DrawablePtr drawable, GCPtr gc,
int height = GLYPHHEIGHTPIXELS(ci);
int tx, ty = 0;
int row = 0, col;
int second_row = 0;
x += ci->metrics.characterWidth;
if (sixteen) {
@ -153,8 +153,10 @@ glamor_text(DrawablePtr drawable, GCPtr gc,
row = chars[0];
col = chars[1];
}
if (FONTLASTROW(font) != 0)
ty = (row - firstRow) * glyph_spacing_y;
if (FONTLASTROW(font) != 0) {
ty = ((row - firstRow) / 2) * glyph_spacing_y;
second_row = (row - firstRow) & 1;
}
else
col += row << 8;
} else {
@ -165,6 +167,8 @@ glamor_text(DrawablePtr drawable, GCPtr gc,
}
tx = (col - firstCol) * glyph_spacing_x;
/* adjust for second row layout */
tx += second_row * glamor_font->row_width * 8;
v[ 0] = x1;
v[ 1] = y1;