Index: src/pdf/SkPDFStream.cpp |
diff --git a/src/pdf/SkPDFStream.cpp b/src/pdf/SkPDFStream.cpp |
index e709357e607822bac30d17eb3ee9416b4a3011d7..d21205cd38db12c18c0b821f9574738bc6c850e7 100644 |
--- a/src/pdf/SkPDFStream.cpp |
+++ b/src/pdf/SkPDFStream.cpp |
@@ -29,9 +29,9 @@ void SkPDFStream::emitObject(SkWStream* stream, |
if (fState == kUnused_State) { |
fState = kNoCompression_State; |
SkDynamicMemoryWStream compressedData; |
- |
- SkAssertResult( |
- SkFlate::Deflate(fDataStream.get(), &compressedData)); |
+ SkDeflateWStream deflateWStream(&compressedData); |
+ SkAssertResult(SkStreamCopy(&deflateWStream, fDataStream.get())); |
+ deflateWStream.finalize(); |
SkAssertResult(fDataStream->rewind()); |
if (compressedData.getOffset() < this->dataSize()) { |
SkAutoTDelete<SkStream> compressed( |