Chromium Code Reviews| Index: Source/platform/fonts/shaping/SimpleShaper.cpp |
| diff --git a/Source/platform/fonts/shaping/SimpleShaper.cpp b/Source/platform/fonts/shaping/SimpleShaper.cpp |
| index 96ac427777721d85d21b509439a992c461529071..4566f130a94f6f8b8bd39a4485ac1fced8eb47e2 100644 |
| --- a/Source/platform/fonts/shaping/SimpleShaper.cpp |
| +++ b/Source/platform/fonts/shaping/SimpleShaper.cpp |
| @@ -37,9 +37,9 @@ using namespace Unicode; |
| namespace blink { |
| -SimpleShaper::SimpleShaper(const Font* font, const TextRun& run, |
| - HashSet<const SimpleFontData*>* fallbackFonts, FloatRect* bounds, bool forTextEmphasis) |
| - : Shaper(font, run, forTextEmphasis ? ForTextEmphasis : NotForTextEmphasis, fallbackFonts, bounds) |
| +SimpleShaper::SimpleShaper(const Font* font, const TextRun& run, const GlyphData* emphasisData, |
| + HashSet<const SimpleFontData*>* fallbackFonts, FloatRect* bounds) |
| + : Shaper(font, run, emphasisData, fallbackFonts, bounds) |
| , m_currentCharacter(0) |
| , m_runWidthSoFar(0) |
| { |
| @@ -173,18 +173,15 @@ unsigned SimpleShaper::advanceInternal(TextIterator& textIterator, GlyphBuffer* |
| m_glyphBoundingBox->unite(glyphBounds); |
| } |
| - if (m_forTextEmphasis) { |
| - if (!Character::canReceiveTextEmphasis(charData.character)) |
| - glyph = 0; |
| - |
| - // The emphasis code expects mid-glyph offsets. |
| - width /= 2; |
| - m_runWidthSoFar += width; |
| + if (glyphBuffer) { |
| + if (!forTextEmphasis()) { |
| + glyphBuffer->add(glyph, fontData, m_runWidthSoFar); |
| + } else { |
|
jbroman
2015/03/07 18:50:25
nit: consider
} else if (...) {
to avoid the ext
f(malita)
2015/03/09 15:04:55
Done.
|
| + if (Character::canReceiveTextEmphasis(charData.character)) |
| + addEmphasisMark(glyphBuffer, m_runWidthSoFar + width / 2); |
| + } |
| } |
| - if (glyphBuffer) |
| - glyphBuffer->add(glyph, fontData, m_runWidthSoFar); |
| - |
| // Advance past the character we just dealt with. |
| textIterator.advance(charData.clusterLength); |
| m_runWidthSoFar += width; |