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

Unified Diff: third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp

Issue 1591883002: Add plumbing in blink to allow overriding the default font collection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add back the option to use blink with DirectWrite without specifying a font manager, which was appa… Created 4 years, 10 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: third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp b/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
index b34762474b583cb88d8e45eb0babd6413200017a..0c4ef28ceff35ebc4692549cea495e3165e966a4 100644
--- a/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
+++ b/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
@@ -97,19 +97,19 @@ void FontCache::setStatusFontMetrics(const wchar_t* familyName, int32_t fontHeig
FontCache::FontCache()
: m_purgePreventCount(0)
{
- SkFontMgr* fontManager;
-
- if (s_useDirectWrite) {
- fontManager = SkFontMgr_New_DirectWrite(s_directWriteFactory);
- s_useSubpixelPositioning = true;
+ if (s_fontManager) {
+ adopted(s_fontManager);
bungeman-chromium 2016/02/09 22:25:17 The adoption checks are only done in debug, so 'ad
jbroman 2016/02/09 22:31:30 Well, it does exist here: https://code.google.com/
bungeman-chromium 2016/02/09 22:36:05 Note that adding 'using WTF::adopted' should work
+ m_fontManager = s_fontManager;
+ } else if (s_useDirectWrite) {
+ m_fontManager = adoptRef(SkFontMgr_New_DirectWrite());
bungeman-chromium 2016/02/04 21:40:32 I'm assuming this is only true then not running in
Ilya Kulshin 2016/02/05 02:02:47 Yes, I believe this case only happens during tests
} else {
- fontManager = SkFontMgr_New_GDI();
- // Subpixel text positioning is not supported by the GDI backend.
- s_useSubpixelPositioning = false;
+ m_fontManager = adoptRef(SkFontMgr_New_GDI());
}
- ASSERT(fontManager);
- m_fontManager = adoptPtr(fontManager);
+ // Subpixel text positioning is only supported by the DirectWrite backend (not GDI).
+ s_useSubpixelPositioning = s_useDirectWrite;
+
+ ASSERT(m_fontManager.get());
}
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/FontCache.cpp ('k') | third_party/WebKit/Source/web/win/WebFontRendering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698