Index: src/pdf/SkPDFStream.cpp |
diff --git a/src/pdf/SkPDFStream.cpp b/src/pdf/SkPDFStream.cpp |
index a6b2ec8b8e3112a019944603d007b097c55f8d43..4ae1f39d26f18dc9783c5bcf1decb75c7a828b05 100644 |
--- a/src/pdf/SkPDFStream.cpp |
+++ b/src/pdf/SkPDFStream.cpp |
@@ -25,9 +25,7 @@ SkPDFStream::SkPDFStream(SkStream* stream) |
} |
SkPDFStream::SkPDFStream(SkData* data) : fState(kUnused_State) { |
- SkMemoryStream* stream = new SkMemoryStream; |
- stream->setData(data); |
- fData.reset(stream); // Transfer ownership. |
+ setData(data); |
} |
SkPDFStream::SkPDFStream(const SkPDFStream& pdfStream) |
@@ -84,6 +82,12 @@ size_t SkPDFStream::getOutputSize(SkPDFCatalog* catalog, bool indirect) { |
SkPDFStream::SkPDFStream() : fState(kUnused_State) {} |
+void SkPDFStream::setData(SkData* data) { |
+ SkMemoryStream* stream = new SkMemoryStream; |
+ stream->setData(data); |
+ fData.reset(stream); // Transfer ownership. |
+} |
+ |
void SkPDFStream::setData(SkStream* stream) { |
fData.reset(stream); |
SkSafeRef(stream); |