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

Unified Diff: src/ports/SkFontHost_win.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_mac.cpp ('k') | src/ports/SkTypeface_win_dw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_win.cpp
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index db90915acae6648c938dda93c09650146c33f5b5..7c0a639b4bf334e5dc9408628657ccd009d25a5e 100644
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -86,8 +86,6 @@ static bool needToRenderWithSkia(const SkScalerContext::Rec& rec) {
return rec.getHinting() == SkPaint::kNo_Hinting || rec.getHinting() == SkPaint::kSlight_Hinting;
}
-using namespace skia_advanced_typeface_metrics_utils;
-
static void tchar_to_skstring(const TCHAR t[], SkString* s) {
#ifdef UNICODE
size_t sSize = WideCharToMultiByte(CP_UTF8, 0, t, -1, nullptr, 0, nullptr, nullptr);
@@ -1835,17 +1833,14 @@ SkAdvancedTypefaceMetrics* LogFontTypeface::onGetAdvancedTypefaceMetrics(
if (perGlyphInfo & kHAdvance_PerGlyphInfo) {
if (info->fStyle & SkAdvancedTypefaceMetrics::kFixedPitch_Style) {
- appendRange(&info->fGlyphWidths, 0);
- info->fGlyphWidths->fAdvance.append(1, &min_width);
- 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(
- getAdvanceData(hdc,
- glyphCount,
- glyphIDs,
- glyphIDsCount,
- &getWidthAdvance));
+ info->setGlyphWidths(hdc, glyphCount, glyphIDs,
+ glyphIDsCount, &getWidthAdvance);
}
}
« no previous file with comments | « src/ports/SkFontHost_mac.cpp ('k') | src/ports/SkTypeface_win_dw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698