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

Unified Diff: src/pdf/SkPDFStream.cpp

Issue 933523007: zlib/pdf: remove HaveFlate(), depend on preprocessor defines (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-02-17 (Tuesday) 17:35:15 EST 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/SkPDFImage.cpp ('k') | tests/FlateTest.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 5eaa6c28b69b3968247b0f72cc11f0dff2d3d0a5..150338b6ca0ec937759b6ef7650f080387f5d65e 100644
--- a/src/pdf/SkPDFStream.cpp
+++ b/src/pdf/SkPDFStream.cpp
@@ -83,8 +83,18 @@ size_t SkPDFStream::dataSize() const {
}
bool SkPDFStream::populate(SkPDFCatalog* catalog) {
+#ifdef SK_NO_FLATE
if (fState == kUnused_State) {
- if (!skip_compression(catalog) && SkFlate::HaveFlate()) {
+ fState = kNoCompression_State;
+ insertInt("Length", this->dataSize());
+ }
+ return true;
+
+#else // !SK_NO_FLATE
+
+ if (fState == kUnused_State) {
+ fState = kNoCompression_State;
+ if (!skip_compression(catalog)) {
SkDynamicMemoryWStream compressedData;
SkAssertResult(
@@ -101,8 +111,8 @@ bool SkPDFStream::populate(SkPDFCatalog* catalog) {
fState = kNoCompression_State;
}
insertInt("Length", this->dataSize());
- } else if (fState == kNoCompression_State && !skip_compression(catalog) &&
- SkFlate::HaveFlate()) {
+ }
+ else if (fState == kNoCompression_State && !skip_compression(catalog)) {
if (!fSubstitute.get()) {
fSubstitute.reset(new SkPDFStream(*this));
catalog->setSubstitute(this, fSubstitute.get());
@@ -110,4 +120,5 @@ bool SkPDFStream::populate(SkPDFCatalog* catalog) {
return false;
}
return true;
+#endif // SK_NO_FLATE
}
« no previous file with comments | « src/pdf/SkPDFImage.cpp ('k') | tests/FlateTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698