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

Unified Diff: src/pdf/SkPDFStream.cpp

Issue 18328026: Added SkPDFStream::setData(SkData*) in preparation for move from SkStream to SkData (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 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/pdf/SkPDFStream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/pdf/SkPDFStream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698