Backed out changeset acd7efb271c8 (bug 1211867)

This commit is contained in:
Wes Kocher 2015-10-14 09:04:27 -07:00
Родитель 8dd36993ac
Коммит 5166673512
1 изменённых файлов: 11 добавлений и 19 удалений

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

@ -2343,15 +2343,10 @@ gfxFont::NotifyGlyphsChanged()
}
}
// If aChar is a "word boundary" for shaped-word caching purposes, return it;
// else return 0.
static char16_t
static bool
IsBoundarySpace(char16_t aChar, char16_t aNextChar)
{
if ((aChar == ' ' || aChar == 0x00A0) && !IsClusterExtender(aNextChar)) {
return aChar;
}
return 0;
return (aChar == ' ' || aChar == 0x00A0) && !IsClusterExtender(aNextChar);
}
#ifdef __GNUC__
@ -2770,7 +2765,7 @@ gfxFont::SplitAndInitTextRun(gfxContext *aContext,
for (uint32_t i = 0; i <= aRunLength; ++i) {
T ch = nextCh;
nextCh = (i < aRunLength - 1) ? aString[i + 1] : '\n';
T boundary = IsBoundarySpace(ch, nextCh);
bool boundary = IsBoundarySpace(ch, nextCh);
bool invalid = !boundary && gfxFontGroup::IsInvalidChar(ch);
uint32_t length = i - wordStart;
@ -2832,19 +2827,16 @@ gfxFont::SplitAndInitTextRun(gfxContext *aContext,
gfxTextRunFactory::TEXT_ORIENT_VERTICAL_UPRIGHT :
gfxTextRunFactory::TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT;
}
if (boundary != ' ' ||
!aTextRun->SetSpaceGlyphIfSimple(this, aContext,
if (!aTextRun->SetSpaceGlyphIfSimple(this, aContext,
aRunStart + i, ch,
orientation)) {
// Currently, the only "boundary" characters we recognize are
// space and no-break space, which are both 8-bit, so we force
// that flag (below). If we ever change IsBoundarySpace, we
// may need to revise this.
NS_ASSERTION(uint32_t(boundary) < 256, "unexpected boundary!");
orientation))
{
static const uint8_t space = ' ';
gfxShapedWord *sw =
GetShapedWord(aContext, &boundary, 1,
gfxShapedWord::HashMix(0, boundary),
aRunScript, aVertical, appUnitsPerDevUnit,
GetShapedWord(aContext,
&space, 1,
gfxShapedWord::HashMix(0, ' '), aRunScript, aVertical,
appUnitsPerDevUnit,
flags | gfxTextRunFactory::TEXT_IS_8BIT, tp);
if (sw) {
aTextRun->CopyGlyphDataFrom(sw, aRunStart + i);