Merge mozilla-central and mozilla-inbound

This commit is contained in:
Ehsan Akhgari 2011-09-12 09:54:28 -04:00
Родитель ba532975cf 9cfbcccfc0
Коммит 2b560c92e4
1 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -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;
}