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

Unified Diff: src/core/SkPaint.cpp

Issue 563273003: remove confusing/unused stream methods (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « include/core/SkStream.h ('k') | src/core/SkStream.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 5d7c2cc3ebc4420b3ef5e027d291e2159d984a0a..1c2f8e83a6eba738ec542ac1f96808392556db8e 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -2307,17 +2307,20 @@ 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);
+}
+
void SkPaint::toString(SkString* str) const {
str->append("<dl><dt>SkPaint:</dt><dd><dl>");
SkTypeface* typeface = this->getTypeface();
if (typeface) {
- SkDynamicMemoryWStream ostream;
- typeface->serialize(&ostream);
- SkAutoTUnref<SkData> data(ostream.copyToData());
-
- SkMemoryStream stream(data);
- SkFontDescriptor descriptor(&stream);
+ SkFontDescriptor descriptor(typeface_getDescriptor(typeface));
str->append("<dt>Font Family Name:</dt><dd>");
str->append(descriptor.getFamilyName());
« no previous file with comments | « include/core/SkStream.h ('k') | src/core/SkStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698