Index: src/pdf/SkPDFTypes.cpp |
diff --git a/src/pdf/SkPDFTypes.cpp b/src/pdf/SkPDFTypes.cpp |
index 5eb5c39c0e1397898b8707dcbb502d68c6e6fd1a..285da38513127e47ed12bacdf1329b242c03110f 100644 |
--- a/src/pdf/SkPDFTypes.cpp |
+++ b/src/pdf/SkPDFTypes.cpp |
@@ -465,6 +465,28 @@ void SkPDFSharedStream::drop() { |
SkDEBUGCODE(fDumped = true;) |
} |
+#ifdef SK_PDF_LESS_COMPRESSION |
+void SkPDFSharedStream::emitObject( |
+ SkWStream* stream, |
+ const SkPDFObjNumMap& objNumMap, |
+ const SkPDFSubstituteMap& substitutes) const { |
+ SkASSERT(!fDumped); |
+ std::unique_ptr<SkStreamAsset> dup(fAsset->duplicate()); |
+ SkASSERT(dup && dup->hasLength()); |
+ size_t length = dup->getLength(); |
+ stream->writeText("<<"); |
+ fDict->emitAll(stream, objNumMap, substitutes); |
+ stream->writeText("\n"); |
+ SkPDFUnion::Name("Length").emitObject( |
+ stream, objNumMap, substitutes); |
+ stream->writeText(" "); |
+ SkPDFUnion::Int(length).emitObject( |
+ stream, objNumMap, substitutes); |
+ stream->writeText("\n>>stream\n"); |
+ SkStreamCopy(stream, dup.get()); |
+ stream->writeText("\nendstream"); |
+} |
+#else |
void SkPDFSharedStream::emitObject( |
SkWStream* stream, |
const SkPDFObjNumMap& objNumMap, |
@@ -493,6 +515,7 @@ void SkPDFSharedStream::emitObject( |
buffer.writeToStream(stream); |
stream->writeText("\nendstream"); |
} |
+#endif |
void SkPDFSharedStream::addResources( |
SkPDFObjNumMap* catalog, const SkPDFSubstituteMap& substitutes) const { |