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

Unified Diff: src/core/SkPaint.cpp

Issue 567013002: Serialize the font index. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move data into descriptor. Created 6 years, 3 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
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 1c2f8e83a6eba738ec542ac1f96808392556db8e..88bde227044a76b702a7a6be0f010b48b0b33928 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -2308,19 +2308,15 @@ const SkRect& SkPaint::doComputeFastBounds(const SkRect& origSrc,
#ifndef SK_IGNORE_TO_STRING
-static SkFontDescriptor typeface_getDescriptor(const SkTypeface* face) {
- SkDynamicMemoryWStream ostream;
- face->serialize(&ostream);
- SkAutoTUnref<SkStreamAsset> istream(ostream.detachAsStream());
- return SkFontDescriptor(istream);
bungeman-skia 2014/09/18 14:50:09 This required a copy constructor, and that seems a
-}
-
void SkPaint::toString(SkString* str) const {
str->append("<dl><dt>SkPaint:</dt><dd><dl>");
SkTypeface* typeface = this->getTypeface();
if (typeface) {
- SkFontDescriptor descriptor(typeface_getDescriptor(typeface));
+ SkDynamicMemoryWStream ostream;
+ typeface->serialize(&ostream);
+ SkAutoTUnref<SkStreamAsset> istream(ostream.detachAsStream());
+ SkFontDescriptor descriptor(istream);
str->append("<dt>Font Family Name:</dt><dd>");
str->append(descriptor.getFamilyName());

Powered by Google App Engine
This is Rietveld 408576698