aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PDFPrimitivesTest.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-08-18 13:30:25 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-18 13:30:25 -0700
commit48305e835351291ef72a7084c6c1af7b185d89c0 (patch)
tree56cf2a20e842163148bb212f9ab606deede363d4 /tests/PDFPrimitivesTest.cpp
parenta44919ea27acd9808a7581362018484355c0f026 (diff)
SkPDF/Deflate: clean up old SkFlate code
Factor out some of https://crrev.com/1227913008 BUG=skia:3030 Review URL: https://codereview.chromium.org/1298243002
Diffstat (limited to 'tests/PDFPrimitivesTest.cpp')
-rw-r--r--tests/PDFPrimitivesTest.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp
index b0b776527f..1d35c08cbb 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -99,12 +99,14 @@ static void TestPDFStream(skiatest::Reporter* reporter) {
SkAutoTUnref<SkPDFStream> stream(new SkPDFStream(streamData2.get()));
SkDynamicMemoryWStream compressedByteStream;
- SkFlate::Deflate(streamData2.get(), &compressedByteStream);
- SkAutoDataUnref compressedData(compressedByteStream.copyToData());
+ SkDeflateWStream deflateWStream(&compressedByteStream);
+ deflateWStream.write(streamBytes2, strlen(streamBytes2));
+ deflateWStream.finalize();
SkDynamicMemoryWStream expected;
expected.writeText("<</Filter /FlateDecode\n/Length 116>> stream\n");
- expected.write(compressedData->data(), compressedData->size());
+ compressedByteStream.writeToStream(&expected);
+ compressedByteStream.reset();
expected.writeText("\nendstream");
SkAutoDataUnref expectedResultData2(expected.copyToData());
SkString result = emit_to_string(*stream);