Index: src/utils/SkWhitelistTypefaces.cpp |
diff --git a/src/utils/SkWhitelistTypefaces.cpp b/src/utils/SkWhitelistTypefaces.cpp |
index bc454bfe1d4544f40200de7202d7f92f3de9b83e..2912fe2501788f6567d38d8fa8786827e9b44a98 100644 |
--- a/src/utils/SkWhitelistTypefaces.cpp |
+++ b/src/utils/SkWhitelistTypefaces.cpp |
@@ -83,12 +83,13 @@ static uint32_t compute_checksum(const SkTypeface* tf) { |
return SkChecksum::Murmur3(data.begin(), length); |
} |
-static void serialize_sub(const char* fontName, SkTypeface::Style style, SkWStream* wstream) { |
- SkFontDescriptor desc(style); |
+static void serialize_sub(const char* fontName, SkFontStyle style, SkWStream* wstream) { |
+ SkFontDescriptor desc; |
SkString subName(SUBNAME_PREFIX); |
subName.append(fontName); |
const char* familyName = subName.c_str(); |
desc.setFamilyName(familyName); |
+ desc.setStyle(style); |
desc.serialize(wstream); |
#if WHITELIST_DEBUG |
for (int i = 0; i < whitelistCount; ++i) { |
@@ -105,14 +106,14 @@ static void serialize_sub(const char* fontName, SkTypeface::Style style, SkWStre |
static bool is_local(const SkTypeface* tf) { |
bool isLocal = false; |
- SkFontDescriptor desc(tf->style()); |
+ SkFontDescriptor desc; |
tf->getFontDescriptor(&desc, &isLocal); |
return isLocal; |
} |
static void serialize_full(const SkTypeface* tf, SkWStream* wstream) { |
bool isLocal = false; |
- SkFontDescriptor desc(tf->style()); |
+ SkFontDescriptor desc; |
tf->getFontDescriptor(&desc, &isLocal); |
// Embed font data if it's a local font. |
@@ -124,7 +125,7 @@ static void serialize_full(const SkTypeface* tf, SkWStream* wstream) { |
static void serialize_name_only(const SkTypeface* tf, SkWStream* wstream) { |
bool isLocal = false; |
- SkFontDescriptor desc(tf->style()); |
+ SkFontDescriptor desc; |
tf->getFontDescriptor(&desc, &isLocal); |
SkASSERT(!isLocal); |
#if WHITELIST_DEBUG |
@@ -180,7 +181,7 @@ void WhitelistSerializeTypeface(const SkTypeface* tf, SkWStream* wstream) { |
#endif |
whitelist[whitelistIndex].fChecksum = checksum; |
} |
- serialize_sub(fontName, tf->style(), wstream); |
+ serialize_sub(fontName, tf->fontStyle(), wstream); |
} |
sk_sp<SkTypeface> WhitelistDeserializeTypeface(SkStream* stream) { |
@@ -200,7 +201,7 @@ sk_sp<SkTypeface> WhitelistDeserializeTypeface(SkStream* stream) { |
if (!strncmp(SUBNAME_PREFIX, familyName, sizeof(SUBNAME_PREFIX) - 1)) { |
familyName += sizeof(SUBNAME_PREFIX) - 1; |
} |
- return SkTypeface::MakeFromName(familyName, SkFontStyle::FromOldStyle(desc.getStyle())); |
+ return SkTypeface::MakeFromName(familyName, desc.getStyle()); |
} |
bool CheckChecksums() { |