diff options
Diffstat (limited to 'gfx/thebes/gfxHarfBuzzShaper.cpp')
-rw-r--r-- | gfx/thebes/gfxHarfBuzzShaper.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gfx/thebes/gfxHarfBuzzShaper.cpp b/gfx/thebes/gfxHarfBuzzShaper.cpp index 4a563a95f9..7f05f9011f 100644 --- a/gfx/thebes/gfxHarfBuzzShaper.cpp +++ b/gfx/thebes/gfxHarfBuzzShaper.cpp @@ -817,7 +817,7 @@ GetKernValueVersion1Fmt3(const void* aSubtable, hdr->leftClassCount * hdr->rightClassCount > aSubtableLen) { return 0; } - + if (aFirstGlyph >= glyphCount || aSecondGlyph >= glyphCount) { // glyphs are out of range for the class tables return 0; @@ -1503,6 +1503,8 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(DrawTarget *aDrawTarget, hb_buffer_t *aBuffer, bool aVertical) { + typedef gfxShapedText::CompressedGlyph CompressedGlyph; + uint32_t numGlyphs; const hb_glyph_info_t *ginfo = hb_buffer_get_glyph_infos(aBuffer, &numGlyphs); if (numGlyphs == 0) { @@ -1541,8 +1543,7 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(DrawTarget *aDrawTarget, } int32_t appUnitsPerDevUnit = aShapedText->GetAppUnitsPerDevUnit(); - gfxShapedText::CompressedGlyph *charGlyphs = - aShapedText->GetCharacterGlyphs() + aOffset; + CompressedGlyph* charGlyphs = aShapedText->GetCharacterGlyphs() + aOffset; // factor to convert 16.16 fixed-point pixels to app units // (only used if not rounding) @@ -1688,8 +1689,8 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(DrawTarget *aDrawTarget, } // Check if it's a simple one-to-one mapping if (glyphsInClump == 1 && - gfxTextRun::CompressedGlyph::IsSimpleGlyphID(ginfo[glyphStart].codepoint) && - gfxTextRun::CompressedGlyph::IsSimpleAdvance(advance) && + CompressedGlyph::IsSimpleGlyphID(ginfo[glyphStart].codepoint) && + CompressedGlyph::IsSimpleAdvance(advance) && charGlyphs[baseCharIndex].IsClusterStart() && iOffset == 0 && b_offset == 0 && b_advance == 0 && bPos == 0) @@ -1760,11 +1761,12 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(DrawTarget *aDrawTarget, } } - gfxShapedText::CompressedGlyph g; - g.SetComplex(charGlyphs[baseCharIndex].IsClusterStart(), - true, detailedGlyphs.Length()); + bool isClusterStart = charGlyphs[baseCharIndex].IsClusterStart(); aShapedText->SetGlyphs(aOffset + baseCharIndex, - g, detailedGlyphs.Elements()); + CompressedGlyph::MakeComplex(isClusterStart, + true, + detailedGlyphs.Length()), + detailedGlyphs.Elements()); detailedGlyphs.Clear(); } @@ -1773,7 +1775,7 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(DrawTarget *aDrawTarget, // no associated glyphs while (++baseCharIndex != endCharIndex && baseCharIndex < int32_t(wordLength)) { - gfxShapedText::CompressedGlyph &g = charGlyphs[baseCharIndex]; + CompressedGlyph &g = charGlyphs[baseCharIndex]; NS_ASSERTION(!g.IsSimpleGlyph(), "overwriting a simple glyph"); g.SetComplex(g.IsClusterStart(), false, 0); } |