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

Unified Diff: third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp

Issue 2858573002: Use FreeType for OpenType Variations on CoreText < 10.12 (Closed)
Patch Set: Use FreeType for OpenType Variations on CoreText < 10.12 Created 3 years, 7 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/FontCustomPlatformData.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp b/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
index 8298ac285da0f0602df24ae1ffa47193a4b476d5..2307530e26bc024ce0babe8326e7dfbd091e8093 100644
--- a/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
@@ -37,10 +37,13 @@
#include "platform/fonts/FontCache.h"
#include "platform/fonts/FontPlatformData.h"
#include "platform/fonts/WebFontDecoder.h"
+#if OS(MACOSX)
+#include "platform/fonts/mac/CoreTextVariationsSupport.h"
+#endif
#include "platform/fonts/opentype/FontSettings.h"
#include "third_party/skia/include/core/SkStream.h"
#include "third_party/skia/include/core/SkTypeface.h"
-#if OS(WIN)
+#if OS(WIN) || OS(MACOSX)
#include "third_party/skia/include/ports/SkFontMgr_empty.h"
#endif
#include "platform/wtf/PtrUtil.h"
@@ -74,6 +77,12 @@ FontPlatformData FontCustomPlatformData::GetFontPlatformData(
if (variation_settings && variation_settings->size() < UINT16_MAX) {
#if OS(WIN)
sk_sp<SkFontMgr> fm(SkFontMgr_New_Custom_Empty());
+#elif OS(MACOSX)
+ sk_sp<SkFontMgr> fm;
+ if (CoreTextVersionSupportsVariations())
+ fm = SkFontMgr::RefDefault();
+ else
+ fm = SkFontMgr_New_Custom_Empty();
#else
sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault());
#endif
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | third_party/WebKit/Source/platform/fonts/FontPlatformData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698