diff --git a/include/pdf/SkPDFDocument.h b/include/pdf/SkPDFDocument.h index 167634e0fe..cb786c7133 100644 --- a/include/pdf/SkPDFDocument.h +++ b/include/pdf/SkPDFDocument.h @@ -29,7 +29,10 @@ class SkWStream; class SkPDFDocument { public: enum Flags { - kNoCompression_Flags = 0x01, //!< mask disable stream compression. + kNoCompression_Flags = 0x01, //!< DEPRECATED. + kFavorSpeedOverSize_Flags = 0x01, //!< Don't compress the stream, but + // if it is already compressed return + // the compressed stream. kNoLinks_Flags = 0x02, //!< do not honor link annotations. kDraftMode_Flags = 0x01, diff --git a/src/pdf/SkPDFStream.cpp b/src/pdf/SkPDFStream.cpp index 38e874ea1b..a6b2ec8b8e 100644 --- a/src/pdf/SkPDFStream.cpp +++ b/src/pdf/SkPDFStream.cpp @@ -15,7 +15,7 @@ static bool skip_compression(SkPDFCatalog* catalog) { return SkToBool(catalog->getDocumentFlags() & - SkPDFDocument::kNoCompression_Flags); + SkPDFDocument::kFavorSpeedOverSize_Flags); } SkPDFStream::SkPDFStream(SkStream* stream) diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp index 9d52fcdc49..cc89d6b806 100644 --- a/tests/PDFPrimitivesTest.cpp +++ b/tests/PDFPrimitivesTest.cpp @@ -51,7 +51,7 @@ static void CheckObjectOutput(skiatest::Reporter* reporter, SkPDFObject* obj, bool indirect, bool compression) { SkPDFDocument::Flags docFlags = (SkPDFDocument::Flags) 0; if (!compression) { - docFlags = SkTBitOr(docFlags, SkPDFDocument::kNoCompression_Flags); + docFlags = SkTBitOr(docFlags, SkPDFDocument::kFavorSpeedOverSize_Flags); } SkPDFCatalog catalog(docFlags); size_t directSize = obj->getOutputSize(&catalog, false);