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

Unified Diff: src/utils/SkWhitelistTypefaces.cpp

Issue 2067583002: Revert of Update typeface serialization style. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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 | « src/ports/SkTypeface_win_dw.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkWhitelistTypefaces.cpp
diff --git a/src/utils/SkWhitelistTypefaces.cpp b/src/utils/SkWhitelistTypefaces.cpp
index 2912fe2501788f6567d38d8fa8786827e9b44a98..bc454bfe1d4544f40200de7202d7f92f3de9b83e 100644
--- a/src/utils/SkWhitelistTypefaces.cpp
+++ b/src/utils/SkWhitelistTypefaces.cpp
@@ -83,13 +83,12 @@
return SkChecksum::Murmur3(data.begin(), length);
}
-static void serialize_sub(const char* fontName, SkFontStyle style, SkWStream* wstream) {
- SkFontDescriptor desc;
+static void serialize_sub(const char* fontName, SkTypeface::Style style, SkWStream* wstream) {
+ SkFontDescriptor desc(style);
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) {
@@ -106,14 +105,14 @@
static bool is_local(const SkTypeface* tf) {
bool isLocal = false;
- SkFontDescriptor desc;
+ SkFontDescriptor desc(tf->style());
tf->getFontDescriptor(&desc, &isLocal);
return isLocal;
}
static void serialize_full(const SkTypeface* tf, SkWStream* wstream) {
bool isLocal = false;
- SkFontDescriptor desc;
+ SkFontDescriptor desc(tf->style());
tf->getFontDescriptor(&desc, &isLocal);
// Embed font data if it's a local font.
@@ -125,7 +124,7 @@
static void serialize_name_only(const SkTypeface* tf, SkWStream* wstream) {
bool isLocal = false;
- SkFontDescriptor desc;
+ SkFontDescriptor desc(tf->style());
tf->getFontDescriptor(&desc, &isLocal);
SkASSERT(!isLocal);
#if WHITELIST_DEBUG
@@ -181,7 +180,7 @@
#endif
whitelist[whitelistIndex].fChecksum = checksum;
}
- serialize_sub(fontName, tf->fontStyle(), wstream);
+ serialize_sub(fontName, tf->style(), wstream);
}
sk_sp<SkTypeface> WhitelistDeserializeTypeface(SkStream* stream) {
@@ -201,7 +200,7 @@
if (!strncmp(SUBNAME_PREFIX, familyName, sizeof(SUBNAME_PREFIX) - 1)) {
familyName += sizeof(SUBNAME_PREFIX) - 1;
}
- return SkTypeface::MakeFromName(familyName, desc.getStyle());
+ return SkTypeface::MakeFromName(familyName, SkFontStyle::FromOldStyle(desc.getStyle()));
}
bool CheckChecksums() {
« no previous file with comments | « src/ports/SkTypeface_win_dw.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698