Chromium Code Reviews| 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); |
| } |