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

Unified Diff: Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp

Issue 26335002: Add runtime flag for using DirectWrite on windows (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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: Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp
diff --git a/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp b/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp
index b0f38bba00fed13f1e9e826d2c3268a6f9a91459..cf494a2b5ca033a11cc7cf1e9054f451de9654ae 100644
--- a/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp
+++ b/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp
@@ -32,6 +32,7 @@
#include "config.h"
#include "core/platform/graphics/FontCache.h"
+#include "RuntimeEnabledFeatures.h"
#include "SkFontMgr.h"
#include "SkTypeface_win.h"
#include "platform/NotImplemented.h"
@@ -45,7 +46,16 @@ namespace WebCore {
FontCache::FontCache()
: m_purgePreventCount(0)
{
- m_fontManager = adoptPtr(SkFontMgr_New_GDI());
+ SkFontMgr* fontManager = 0;
+
+ // Prefer DirectWrite (if runtime feature is enabled) but fallback
+ // to GDI on platforms where DirectWrite is not supported.
+ if (RuntimeEnabledFeatures::directWriteEnabled())
+ fontManager = SkFontMgr_New_DirectWrite();
+ if (!fontManager)
+ fontManager = SkFontMgr_New_GDI();
+
+ m_fontManager = adoptPtr(fontManager);
}
« Source/core/page/RuntimeEnabledFeatures.in ('K') | « Source/core/page/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698