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

Unified Diff: Source/platform/fonts/shaping/CachingWordShaper.cpp

Issue 1241613006: Reland "Change fallback font collection in HarfBuzzShaper" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 5 years, 5 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/shaping/CachingWordShaper.cpp
diff --git a/Source/platform/fonts/shaping/CachingWordShaper.cpp b/Source/platform/fonts/shaping/CachingWordShaper.cpp
index b9b2d77c9bad48c9dcf3cb0b6bdb9bb6fc0b6e61..b632fd49e7764c79e964a65396fac03cd3e98844 100644
--- a/Source/platform/fonts/shaping/CachingWordShaper.cpp
+++ b/Source/platform/fonts/shaping/CachingWordShaper.cpp
@@ -56,12 +56,14 @@ float CachingWordShaper::width(const Font* font, const TextRun& run,
{
float width = 0;
RefPtr<ShapeResult> wordResult;
- CachingWordShapeIterator iterator(m_shapeCache, run, font, fallbackFonts);
+ CachingWordShapeIterator iterator(m_shapeCache, run, font);
while (iterator.next(&wordResult)) {
if (wordResult) {
width += wordResult->width();
if (glyphBounds)
glyphBounds->unite(wordResult->bounds());
+ if (fallbackFonts)
+ wordResult->fallbackFonts(fallbackFonts);
}
}
@@ -72,13 +74,15 @@ static inline float shapeResultsForRun(ShapeCache* shapeCache, const Font* font,
const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts,
Vector<RefPtr<ShapeResult>>* results)
{
- CachingWordShapeIterator iterator(shapeCache, run, font, fallbackFonts);
+ CachingWordShapeIterator iterator(shapeCache, run, font);
RefPtr<ShapeResult> wordResult;
float totalWidth = 0;
while (iterator.next(&wordResult)) {
if (wordResult) {
results->append(wordResult);
totalWidth += wordResult->width();
+ if (fallbackFonts)
+ wordResult->fallbackFonts(fallbackFonts);
}
}
return totalWidth;
« no previous file with comments | « Source/platform/fonts/shaping/CachingWordShapeIterator.h ('k') | Source/platform/fonts/shaping/CachingWordShaperTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698