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

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

Issue 2786433004: Support for OpenType Font Variations on Windows (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/LayoutTests/NeverFixTests ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d600bff9cc4121392284e1f6006e09abb269c790..a93d6d9802b3fbe775fba7b5424733643b8c2e6f 100644
--- a/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
@@ -40,13 +40,16 @@
#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)
+#include "third_party/skia/include/ports/SkFontMgr_empty.h"
+#endif
#include "wtf/PtrUtil.h"
namespace blink {
FontCustomPlatformData::FontCustomPlatformData(sk_sp<SkTypeface> typeface,
size_t dataSize)
- : m_baseTypeface(typeface), m_dataSize(dataSize) {}
+ : m_baseTypeface(std::move(typeface)), m_dataSize(dataSize) {}
FontCustomPlatformData::~FontCustomPlatformData() {}
@@ -67,7 +70,11 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(
// reasonable upper limit and leaving the deduplication for TODO(drott),
// crbug.com/674878 second duplicate value should supersede first..
if (variationSettings && variationSettings->size() < UINT16_MAX) {
+#if OS(WIN)
+ sk_sp<SkFontMgr> fm(SkFontMgr_New_Custom_Empty());
+#else
sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault());
+#endif
Vector<SkFontMgr::FontParameters::Axis, 0> axes;
axes.reserveCapacity(variationSettings->size());
for (size_t i = 0; i < variationSettings->size(); ++i) {
« no previous file with comments | « third_party/WebKit/LayoutTests/NeverFixTests ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698