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

Unified Diff: third_party/WebKit/Source/platform/fonts/FontCache.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: Remove setDirectWriteFactory Created 4 years, 11 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/FontCache.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/FontCache.cpp b/third_party/WebKit/Source/platform/fonts/FontCache.cpp
index 462f0d04ff0cd9443d31061f85b23e7733a538f1..d720b5f97409997bf18a438f277eea85facca683 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)
bungeman-chromium 2016/01/21 22:25:09 This doesn't seem to be needed anymore.
Ilya Kulshin 2016/01/27 22:07:25 Done.
+#include <dwrite.h>
+#endif
+
using namespace WTF;
namespace blink {
@@ -72,7 +76,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 +150,15 @@ FontVerticalDataCache& fontVerticalDataCacheInstance()
return fontVerticalDataCache;
}
+#if OS(WIN)
+void FontCache::setFontManager(SkFontMgr* fontManager)
+{
+ s_fontManager = fontManager;
+ // 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();

Powered by Google App Engine
This is Rietveld 408576698