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

Unified Diff: src/ports/SkTypeface_win_dw.cpp

Issue 1955053002: SkAdvancedTypefaceMetrics: getAdvanceData uses std::function (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: typedef 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_win.cpp ('k') | tests/WArrayTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkTypeface_win_dw.cpp
diff --git a/src/ports/SkTypeface_win_dw.cpp b/src/ports/SkTypeface_win_dw.cpp
index de599d67e5dc7cab83c56305a30b430550854ae5..87fbcd2f6cfc70b00190951837f5892afa1d492f 100644
--- a/src/ports/SkTypeface_win_dw.cpp
+++ b/src/ports/SkTypeface_win_dw.cpp
@@ -450,8 +450,13 @@ SkAdvancedTypefaceMetrics* DWriteFontTypeface::onGetAdvancedTypefaceMetrics(
&range, 0, SkAdvancedTypefaceMetrics::WidthRange::kDefault);
info->fGlyphWidths.emplace_back(std::move(range));
} else {
- info->setGlyphWidths(fDWriteFontFace.get(), glyphCount, glyphIDs,
- glyphIDsCount, getWidthAdvance);
+ IDWriteFontFace* borrowedFontFace = fDWriteFontFace.get();
+ info->setGlyphWidths(
+ glyphCount, glyphIDs, glyphIDsCount,
+ SkAdvancedTypefaceMetrics::GetAdvance(
+ [borrowedFontFace](int gId, int16_t* data) {
+ return getWidthAdvance(borrowedFontFace, gId, data);
+ }));
}
}
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | tests/WArrayTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698