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

Unified Diff: src/pdf/SkPDFTypes.cpp

Issue 1840103002: SkPDF: skia_pdf_less_compression - for debugging only (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-03-29 (Tuesday) 12:43:26 EDT Created 4 years, 9 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/SkPDFStream.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « src/pdf/SkPDFStream.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698