Index: third_party/WebKit/Source/platform/fonts/FontCache.cpp |
diff --git a/third_party/WebKit/Source/platform/fonts/FontCache.cpp b/third_party/WebKit/Source/platform/fonts/FontCache.cpp |
index 462f0d04ff0cd9443d31061f85b23e7733a538f1..15cddd32ae52d375039e62a213bf175b5a7a1b48 100644 |
--- a/third_party/WebKit/Source/platform/fonts/FontCache.cpp |
+++ b/third_party/WebKit/Source/platform/fonts/FontCache.cpp |
@@ -53,6 +53,10 @@ |
#include "wtf/text/AtomicStringHash.h" |
#include "wtf/text/StringHash.h" |
+#if OS(WIN) |
+#include <dwrite.h> |
+#endif |
+ |
using namespace WTF; |
namespace blink { |
@@ -73,6 +77,7 @@ static FallbackListShaperCache* gFallbackListShaperCache = nullptr; |
#if OS(WIN) |
bool FontCache::s_useDirectWrite = false; |
IDWriteFactory* FontCache::s_directWriteFactory = 0; |
+SkFontMgr* FontCache::s_fontManager = nullptr; |
bool FontCache::s_useSubpixelPositioning = false; |
float FontCache::s_deviceScaleFactor = 1.0; |
#endif // OS(WIN) |
@@ -146,6 +151,22 @@ FontVerticalDataCache& fontVerticalDataCacheInstance() |
return fontVerticalDataCache; |
} |
+#if OS(WIN) |
+void FontCache::setDirectWriteFactory(IDWriteFactory* factory) |
+{ |
+ s_directWriteFactory = factory; |
+ // Explicitly AddRef since we're going to hold on to the object for the life of the program. |
+ s_directWriteFactory->AddRef(); |
+} |
+ |
+void FontCache::setFontManager(const skia::RefPtr<SkFontMgr>& fontManager) |
+{ |
+ s_fontManager = fontManager.get(); |
+ // Explicitly AddRef since we're going to hold on to the object for the life of the program. |
+ s_fontManager->ref(); |
+} |
+#endif |
+ |
PassRefPtr<OpenTypeVerticalData> FontCache::getVerticalData(const FontFileKey& key, const FontPlatformData& platformData) |
{ |
FontVerticalDataCache& fontVerticalDataCache = fontVerticalDataCacheInstance(); |