Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2433)

Unified Diff: Source/platform/fonts/Font.cpp

Issue 613193002: Avoid drawing emphasis marks over ellipsis glyphs (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated to not add in glyph buffer ellipsis character Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/platform/fonts/Font.cpp
diff --git a/Source/platform/fonts/Font.cpp b/Source/platform/fonts/Font.cpp
index b8a6c1ebdce0dc8a8d4ad20fae356a02b853a8de..caaf9792be8e69da738c22750fb1442c77803a45 100644
--- a/Source/platform/fonts/Font.cpp
+++ b/Source/platform/fonts/Font.cpp
@@ -961,21 +961,12 @@ float Font::drawComplexText(GraphicsContext* gc, const TextRunPaintInfo& runInfo
void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const AtomicString& mark, const FloatPoint& point) const
{
GlyphBuffer glyphBuffer;
-
- float initialAdvance = getGlyphsAndAdvancesForComplexText(runInfo, glyphBuffer, ForTextEmphasis);
-
- if (glyphBuffer.isEmpty())
- return;
-
- drawEmphasisMarks(context, runInfo, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
-}
-
-float Font::getGlyphsAndAdvancesForComplexText(const TextRunPaintInfo& runInfo, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const
-{
HarfBuzzShaper shaper(this, runInfo.run, HarfBuzzShaper::ForTextEmphasis);
shaper.setDrawRange(runInfo.from, runInfo.to);
- shaper.shape(&glyphBuffer);
- return 0;
+ if (!shaper.shape(&glyphBuffer) || glyphBuffer.isEmpty())
+ return;
+
+ drawEmphasisMarks(context, runInfo, glyphBuffer, mark, point);
}
float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, IntRectExtent* glyphBounds) const

Powered by Google App Engine
This is Rietveld 408576698