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

Unified Diff: src/core/SkPaint.cpp

Issue 1732263003: Make skpinfo able to inspect SK_PICT_TYPEFACE_TAG blocks (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address code review issues Created 4 years, 10 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.cpp ('k') | src/core/SkTypeface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index d3384a628d05dc421758816d893bbbb7800fe403..8c468ea918773cbf79caa58c4564a5ddf0b35865 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -2123,15 +2123,19 @@ void SkPaint::toString(SkString* str) const {
SkDynamicMemoryWStream ostream;
typeface->serialize(&ostream);
SkAutoTDelete<SkStreamAsset> istream(ostream.detachAsStream());
- SkFontDescriptor descriptor(istream);
-
- str->append("<dt>Font Family Name:</dt><dd>");
- str->append(descriptor.getFamilyName());
- str->append("</dd><dt>Font Full Name:</dt><dd>");
- str->append(descriptor.getFullName());
- str->append("</dd><dt>Font PS Name:</dt><dd>");
- str->append(descriptor.getPostscriptName());
- str->append("</dd>");
+
+ SkFontDescriptor descriptor;
+ if (!SkFontDescriptor::Deserialize(istream, &descriptor)) {
+ str->append("<dt>FontDescriptor deserialization failed</dt>");
+ } else {
+ str->append("<dt>Font Family Name:</dt><dd>");
+ str->append(descriptor.getFamilyName());
+ str->append("</dd><dt>Font Full Name:</dt><dd>");
+ str->append(descriptor.getFullName());
+ str->append("</dd><dt>Font PS Name:</dt><dd>");
+ str->append(descriptor.getPostscriptName());
+ str->append("</dd>");
+ }
}
str->append("<dt>TextSize:</dt><dd>");
« no previous file with comments | « src/core/SkFontDescriptor.cpp ('k') | src/core/SkTypeface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698