зеркало из https://github.com/mozilla/pjs.git
Merge mozilla-central and mozilla-inbound
This commit is contained in:
Коммит
2b560c92e4
|
@ -1111,10 +1111,10 @@ struct GlyphBuffer {
|
|||
|
||||
void Flush(cairo_t *aCR, PRBool aDrawToPath, PRBool aReverse,
|
||||
PRBool aFinish = PR_FALSE) {
|
||||
// Ensure there's enough room for at least two glyphs in the
|
||||
// buffer (because we may allocate two glyphs between flushes)
|
||||
if (!aFinish && mNumGlyphs + 2 <= GLYPH_BUFFER_SIZE)
|
||||
// Ensure there's enough room for a glyph to be added to the buffer
|
||||
if (!aFinish && mNumGlyphs < GLYPH_BUFFER_SIZE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (aReverse) {
|
||||
for (PRUint32 i = 0; i < mNumGlyphs/2; ++i) {
|
||||
|
@ -1222,6 +1222,7 @@ gfxFont::Draw(gfxTextRun *aTextRun, PRUint32 aStart, PRUint32 aEnd,
|
|||
}
|
||||
glyph->x = ToDeviceUnits(glyphX, devUnitsPerAppUnit);
|
||||
glyph->y = ToDeviceUnits(y, devUnitsPerAppUnit);
|
||||
glyphs.Flush(cr, aDrawToPath, isRTL);
|
||||
|
||||
// synthetic bolding by multi-striking with 1-pixel offsets
|
||||
// at least once, more if there's room (large font sizes)
|
||||
|
@ -1237,10 +1238,9 @@ gfxFont::Draw(gfxTextRun *aTextRun, PRUint32 aStart, PRUint32 aEnd,
|
|||
devUnitsPerAppUnit);
|
||||
doubleglyph->y = glyph->y;
|
||||
strikeOffset += synBoldOnePixelOffset;
|
||||
glyphs.Flush(cr, aDrawToPath, isRTL);
|
||||
} while (--strikeCount > 0);
|
||||
}
|
||||
|
||||
glyphs.Flush(cr, aDrawToPath, isRTL);
|
||||
} else {
|
||||
PRUint32 glyphCount = glyphData->GetGlyphCount();
|
||||
if (glyphCount > 0) {
|
||||
|
@ -1275,6 +1275,7 @@ gfxFont::Draw(gfxTextRun *aTextRun, PRUint32 aStart, PRUint32 aEnd,
|
|||
}
|
||||
glyph->x = ToDeviceUnits(glyphX, devUnitsPerAppUnit);
|
||||
glyph->y = ToDeviceUnits(y + details->mYOffset, devUnitsPerAppUnit);
|
||||
glyphs.Flush(cr, aDrawToPath, isRTL);
|
||||
|
||||
if (IsSyntheticBold()) {
|
||||
double strikeOffset = synBoldOnePixelOffset;
|
||||
|
@ -1289,10 +1290,9 @@ gfxFont::Draw(gfxTextRun *aTextRun, PRUint32 aStart, PRUint32 aEnd,
|
|||
devUnitsPerAppUnit);
|
||||
doubleglyph->y = glyph->y;
|
||||
strikeOffset += synBoldOnePixelOffset;
|
||||
glyphs.Flush(cr, aDrawToPath, isRTL);
|
||||
} while (--strikeCount > 0);
|
||||
}
|
||||
|
||||
glyphs.Flush(cr, aDrawToPath, isRTL);
|
||||
}
|
||||
x += direction*advance;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче