зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset acd7efb271c8 (bug 1211867
)
This commit is contained in:
Родитель
8dd36993ac
Коммит
5166673512
|
@ -2343,15 +2343,10 @@ gfxFont::NotifyGlyphsChanged()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If aChar is a "word boundary" for shaped-word caching purposes, return it;
|
static bool
|
||||||
// else return 0.
|
|
||||||
static char16_t
|
|
||||||
IsBoundarySpace(char16_t aChar, char16_t aNextChar)
|
IsBoundarySpace(char16_t aChar, char16_t aNextChar)
|
||||||
{
|
{
|
||||||
if ((aChar == ' ' || aChar == 0x00A0) && !IsClusterExtender(aNextChar)) {
|
return (aChar == ' ' || aChar == 0x00A0) && !IsClusterExtender(aNextChar);
|
||||||
return aChar;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
@ -2770,7 +2765,7 @@ gfxFont::SplitAndInitTextRun(gfxContext *aContext,
|
||||||
for (uint32_t i = 0; i <= aRunLength; ++i) {
|
for (uint32_t i = 0; i <= aRunLength; ++i) {
|
||||||
T ch = nextCh;
|
T ch = nextCh;
|
||||||
nextCh = (i < aRunLength - 1) ? aString[i + 1] : '\n';
|
nextCh = (i < aRunLength - 1) ? aString[i + 1] : '\n';
|
||||||
T boundary = IsBoundarySpace(ch, nextCh);
|
bool boundary = IsBoundarySpace(ch, nextCh);
|
||||||
bool invalid = !boundary && gfxFontGroup::IsInvalidChar(ch);
|
bool invalid = !boundary && gfxFontGroup::IsInvalidChar(ch);
|
||||||
uint32_t length = i - wordStart;
|
uint32_t length = i - wordStart;
|
||||||
|
|
||||||
|
@ -2832,19 +2827,16 @@ gfxFont::SplitAndInitTextRun(gfxContext *aContext,
|
||||||
gfxTextRunFactory::TEXT_ORIENT_VERTICAL_UPRIGHT :
|
gfxTextRunFactory::TEXT_ORIENT_VERTICAL_UPRIGHT :
|
||||||
gfxTextRunFactory::TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT;
|
gfxTextRunFactory::TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT;
|
||||||
}
|
}
|
||||||
if (boundary != ' ' ||
|
if (!aTextRun->SetSpaceGlyphIfSimple(this, aContext,
|
||||||
!aTextRun->SetSpaceGlyphIfSimple(this, aContext,
|
|
||||||
aRunStart + i, ch,
|
aRunStart + i, ch,
|
||||||
orientation)) {
|
orientation))
|
||||||
// Currently, the only "boundary" characters we recognize are
|
{
|
||||||
// space and no-break space, which are both 8-bit, so we force
|
static const uint8_t space = ' ';
|
||||||
// that flag (below). If we ever change IsBoundarySpace, we
|
|
||||||
// may need to revise this.
|
|
||||||
NS_ASSERTION(uint32_t(boundary) < 256, "unexpected boundary!");
|
|
||||||
gfxShapedWord *sw =
|
gfxShapedWord *sw =
|
||||||
GetShapedWord(aContext, &boundary, 1,
|
GetShapedWord(aContext,
|
||||||
gfxShapedWord::HashMix(0, boundary),
|
&space, 1,
|
||||||
aRunScript, aVertical, appUnitsPerDevUnit,
|
gfxShapedWord::HashMix(0, ' '), aRunScript, aVertical,
|
||||||
|
appUnitsPerDevUnit,
|
||||||
flags | gfxTextRunFactory::TEXT_IS_8BIT, tp);
|
flags | gfxTextRunFactory::TEXT_IS_8BIT, tp);
|
||||||
if (sw) {
|
if (sw) {
|
||||||
aTextRun->CopyGlyphDataFrom(sw, aRunStart + i);
|
aTextRun->CopyGlyphDataFrom(sw, aRunStart + i);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче