Chromium Code Reviews| 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 0564687282805a3959bc4f44b00890e0b0d196c2..b3e4eaf4e6529b167493d31fc3f663175d85e692 100644 |
| --- a/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp |
| +++ b/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp |
| @@ -97,19 +97,18 @@ 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) { |
| + m_fontManager = skia::SharePtr(s_fontManager); |
| + } else if (s_useDirectWrite) { |
| + m_fontManager = skia::AdoptRef(SkFontMgr_New_DirectWrite(s_directWriteFactory)); |
|
bungeman-chromium
2016/01/21 15:48:13
This appears to be the only place s_directWriteFac
Ilya Kulshin
2016/01/21 20:59:22
s_useDirectWrite is set via setUseDirectWrite, whi
bungeman-skia
2016/01/21 21:11:40
Sure, s_useDirectWrite is still called (and should
|
| } else { |
| - fontManager = SkFontMgr_New_GDI(); |
| - // Subpixel text positioning is not supported by the GDI backend. |
| - s_useSubpixelPositioning = false; |
| + m_fontManager = skia::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()); |
| } |