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

Unified Diff: Source/platform/fonts/mac/FontComplexTextMac.cpp

Issue 519373002: Return width from drawText to stop re-measure in Canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updating Test Expectation file Created 6 years, 3 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
« no previous file with comments | « Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp ('k') | Source/platform/fonts/mac/FontMac.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/mac/FontComplexTextMac.cpp
diff --git a/Source/platform/fonts/mac/FontComplexTextMac.cpp b/Source/platform/fonts/mac/FontComplexTextMac.cpp
index 02b2900d733d31662da2514aef392230ed1bd527..a11f6f93c9c82a3ee1e558bbc8c20d3cb8d236ed 100644
--- a/Source/platform/fonts/mac/FontComplexTextMac.cpp
+++ b/Source/platform/fonts/mac/FontComplexTextMac.cpp
@@ -90,15 +90,14 @@ float Font::getGlyphsAndAdvancesForComplexText(const TextRunPaintInfo& runInfo,
return initialAdvance;
}
-void Font::drawComplexText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const FloatPoint& point) const
+float Font::drawComplexText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const FloatPoint& point) const
{
if (preferHarfBuzz(this)) {
GlyphBuffer glyphBuffer;
HarfBuzzShaper shaper(this, runInfo.run);
shaper.setDrawRange(runInfo.from, runInfo.to);
if (shaper.shape(&glyphBuffer)) {
- drawGlyphBuffer(context, runInfo, glyphBuffer, point);
- return;
+ return drawGlyphBuffer(context, runInfo, glyphBuffer, point);
}
}
// This glyph buffer holds our glyphs + advances + font data for each glyph.
@@ -108,11 +107,11 @@ void Font::drawComplexText(GraphicsContext* context, const TextRunPaintInfo& run
// We couldn't generate any glyphs for the run. Give up.
if (glyphBuffer.isEmpty())
- return;
+ return 0;
// Draw the glyph buffer now at the starting point returned in startX.
FloatPoint startPoint(startX, point.y());
- drawGlyphBuffer(context, runInfo, glyphBuffer, startPoint);
+ return drawGlyphBuffer(context, runInfo, glyphBuffer, startPoint);
}
void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const AtomicString& mark, const FloatPoint& point) const
« no previous file with comments | « Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp ('k') | Source/platform/fonts/mac/FontMac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698