Index: src/pdf/SkPDFUtils.cpp |
diff --git a/src/pdf/SkPDFUtils.cpp b/src/pdf/SkPDFUtils.cpp |
index e488f7da06956ede2d49139a788f3925ccd57b16..0a5be3b076c0e13e080dccf57bd5cd570f72198f 100644 |
--- a/src/pdf/SkPDFUtils.cpp |
+++ b/src/pdf/SkPDFUtils.cpp |
@@ -175,9 +175,7 @@ void SkPDFUtils::EmitPath(const SkPath& path, SkPaint::Style paintStyle, |
case SkPath::kClose_Verb: |
if (fillState != kSingleLine_SkipFillState) { |
ClosePath(¤tSegment); |
- SkData* data = currentSegment.copyToData(); |
- content->write(data->data(), data->size()); |
- data->unref(); |
+ currentSegment.writeToStream(content); |
} |
currentSegment.reset(); |
break; |
@@ -187,9 +185,7 @@ void SkPDFUtils::EmitPath(const SkPath& path, SkPaint::Style paintStyle, |
} |
} |
if (currentSegment.bytesWritten() > 0) { |
- SkData* data = currentSegment.copyToData(); |
- content->write(data->data(), data->size()); |
- data->unref(); |
+ currentSegment.writeToStream(content); |
} |
} |