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

Unified Diff: src/ports/SkFontHost_mac.cpp

Issue 1953153004: SkAdvancedTypefaceMetrics: abstract out linked list (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-05-06 (Friday) 17:00:24 EDT Created 4 years, 7 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 | « src/ports/SkFontHost_FreeType.cpp ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_mac.cpp
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 8593b396117ced96e3a4414b2d069fe03e849ecb..dc1333173597abdeebf8b56ee4a04cc6d8e3f790 100644
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -1619,17 +1619,14 @@ SkAdvancedTypefaceMetrics* SkTypeface_Mac::onGetAdvancedTypefaceMetrics(
if (perGlyphInfo & kHAdvance_PerGlyphInfo) {
if (info->fStyle & SkAdvancedTypefaceMetrics::kFixedPitch_Style) {
- skia_advanced_typeface_metrics_utils::appendRange(&info->fGlyphWidths, 0);
- info->fGlyphWidths->fAdvance.append(1, &min_width);
- skia_advanced_typeface_metrics_utils::finishRange(info->fGlyphWidths.get(), 0,
- SkAdvancedTypefaceMetrics::WidthRange::kDefault);
+ SkAdvancedTypefaceMetrics::WidthRange range(0);
+ range.fAdvance.append(1, &min_width);
+ SkAdvancedTypefaceMetrics::FinishRange(
+ &range, 0, SkAdvancedTypefaceMetrics::WidthRange::kDefault);
+ info->fGlyphWidths.emplace_back(std::move(range));
} else {
- info->fGlyphWidths.reset(
- skia_advanced_typeface_metrics_utils::getAdvanceData(ctFont.get(),
- SkToInt(glyphCount),
- glyphIDs,
- glyphIDsCount,
- &getWidthAdvance));
+ info->setGlyphWidths(ctFont.get(), SkToInt(glyphCount), glyphIDs,
+ glyphIDsCount, &getWidthAdvance);
}
}
return info;
« no previous file with comments | « src/ports/SkFontHost_FreeType.cpp ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698