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 0c4ef28ceff35ebc4692549cea495e3165e966a4..b34762474b583cb88d8e45eb0babd6413200017a 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 @@ |
FontCache::FontCache() |
: m_purgePreventCount(0) |
{ |
- if (s_fontManager) { |
- adopted(s_fontManager); |
- m_fontManager = s_fontManager; |
- } else if (s_useDirectWrite) { |
- m_fontManager = adoptRef(SkFontMgr_New_DirectWrite()); |
+ SkFontMgr* fontManager; |
+ |
+ if (s_useDirectWrite) { |
+ fontManager = SkFontMgr_New_DirectWrite(s_directWriteFactory); |
+ s_useSubpixelPositioning = true; |
} else { |
- m_fontManager = adoptRef(SkFontMgr_New_GDI()); |
- } |
- |
- // Subpixel text positioning is only supported by the DirectWrite backend (not GDI). |
- s_useSubpixelPositioning = s_useDirectWrite; |
- |
- ASSERT(m_fontManager.get()); |
+ fontManager = SkFontMgr_New_GDI(); |
+ // Subpixel text positioning is not supported by the GDI backend. |
+ s_useSubpixelPositioning = false; |
+ } |
+ |
+ ASSERT(fontManager); |
+ m_fontManager = adoptPtr(fontManager); |
} |