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

Unified Diff: Source/platform/fonts/skia/FontCacheSkia.cpp

Issue 235553003: Support sideloaded fonts for DirectWrite (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add ForTesting, iterator name Created 6 years, 8 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/FontCache.h ('k') | Source/platform/fonts/win/FontCacheSkiaWin.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/skia/FontCacheSkia.cpp
diff --git a/Source/platform/fonts/skia/FontCacheSkia.cpp b/Source/platform/fonts/skia/FontCacheSkia.cpp
index 67d20f2a9b2404804879089bd91d7c28eb3a7903..2dc0ef2619b6edc0aea15b59f6091c0004592494 100644
--- a/Source/platform/fonts/skia/FontCacheSkia.cpp
+++ b/Source/platform/fonts/skia/FontCacheSkia.cpp
@@ -124,8 +124,14 @@ PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc
if (fontDescription.style())
style |= SkTypeface::kItalic;
- // FIXME: Use SkFontStyle and matchFamilyStyle instead of legacyCreateTypeface.
#if OS(WIN)
+ if (s_sideloadedFonts) {
+ HashMap<String, SkTypeface*>::iterator sideloadedFont = s_sideloadedFonts->find(name.data());
+ if (sideloadedFont != s_sideloadedFonts->end()) {
+ return adoptRef(sideloadedFont->value);
+ }
+ }
+ // FIXME: Use SkFontStyle and matchFamilyStyle instead of legacyCreateTypeface.
if (m_fontManager)
return adoptRef(m_fontManager->legacyCreateTypeface(name.data(), style));
#endif
« no previous file with comments | « Source/platform/fonts/FontCache.h ('k') | Source/platform/fonts/win/FontCacheSkiaWin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698