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

Unified Diff: src/core/SkFontDescriptor.cpp

Issue 1057413005: Remove filename from SkFontDescriptor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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/core/SkFontDescriptor.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkFontDescriptor.cpp
diff --git a/src/core/SkFontDescriptor.cpp b/src/core/SkFontDescriptor.cpp
index b2622d930007849b69782e003f5bec43d3c52d0d..37274d883cb91ea18a22843d2b438e3f5842adec 100644
--- a/src/core/SkFontDescriptor.cpp
+++ b/src/core/SkFontDescriptor.cpp
@@ -32,6 +32,13 @@ static void read_string(SkStream* stream, SkString* string) {
}
}
+static void skip_string(SkStream* stream) {
+ const uint32_t length = SkToU32(stream->readPackedUInt());
+ if (length > 0) {
+ stream->skip(length);
+ }
+}
+
static void write_string(SkWStream* stream, const SkString& string,
uint32_t id) {
if (!string.isEmpty()) {
@@ -68,7 +75,7 @@ SkFontDescriptor::SkFontDescriptor(SkStream* stream) : fFontIndex(0) {
fFontIndex = read_uint(stream);
break;
case kFontFileName:
- read_string(stream, &fFontFileName);
+ skip_string(stream);
break;
mtklein 2015/04/17 17:00:46 Why do we keep this around? For serialized pictur
bungeman-skia 2015/04/17 17:44:51 Added assert to SkPicture.h and comments here.
default:
SkDEBUGFAIL("Unknown id used by a font descriptor");
@@ -91,7 +98,6 @@ void SkFontDescriptor::serialize(SkWStream* stream) {
write_string(stream, fFamilyName, kFontFamilyName);
write_string(stream, fFullName, kFullName);
write_string(stream, fPostscriptName, kPostscriptName);
- write_string(stream, fFontFileName, kFontFileName);
if (fFontIndex) {
write_uint(stream, fFontIndex, kFontIndex);
}
« no previous file with comments | « src/core/SkFontDescriptor.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698