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

Unified Diff: src/pdf/SkPDFStream.cpp

Issue 936403002: PDF: why do we have flags no one uses (or can use)? (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 10 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/SkPDFPage.cpp ('k') | tests/AnnotationTest.cpp » ('j') | 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 150338b6ca0ec937759b6ef7650f080387f5d65e..4aeb2dbe1ec5694c49d7605d9ca7a1459cac0345 100644
--- a/src/pdf/SkPDFStream.cpp
+++ b/src/pdf/SkPDFStream.cpp
@@ -14,11 +14,6 @@
#include "SkStream.h"
#include "SkStreamPriv.h"
-static bool skip_compression(SkPDFCatalog* catalog) {
- return SkToBool(catalog->getDocumentFlags() &
- SkPDFDocument::kFavorSpeedOverSize_Flags);
-}
-
SkPDFStream::SkPDFStream(SkStream* stream) : fState(kUnused_State) {
this->setData(stream);
}
@@ -94,25 +89,21 @@ bool SkPDFStream::populate(SkPDFCatalog* catalog) {
if (fState == kUnused_State) {
fState = kNoCompression_State;
- if (!skip_compression(catalog)) {
- SkDynamicMemoryWStream compressedData;
-
- SkAssertResult(
- SkFlate::Deflate(fDataStream.get(), &compressedData));
- SkAssertResult(fDataStream->rewind());
- if (compressedData.getOffset() < this->dataSize()) {
- SkAutoTDelete<SkStream> compressed(
- compressedData.detachAsStream());
- this->setData(compressed.get());
- insertName("Filter", "FlateDecode");
- }
- fState = kCompressed_State;
- } else {
- fState = kNoCompression_State;
+ SkDynamicMemoryWStream compressedData;
+
+ SkAssertResult(
+ SkFlate::Deflate(fDataStream.get(), &compressedData));
+ SkAssertResult(fDataStream->rewind());
+ if (compressedData.getOffset() < this->dataSize()) {
+ SkAutoTDelete<SkStream> compressed(
+ compressedData.detachAsStream());
+ this->setData(compressed.get());
+ insertName("Filter", "FlateDecode");
}
+ fState = kCompressed_State;
insertInt("Length", this->dataSize());
}
- else if (fState == kNoCompression_State && !skip_compression(catalog)) {
+ else if (fState == kNoCompression_State) {
if (!fSubstitute.get()) {
fSubstitute.reset(new SkPDFStream(*this));
catalog->setSubstitute(this, fSubstitute.get());
« no previous file with comments | « src/pdf/SkPDFPage.cpp ('k') | tests/AnnotationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698