Index: src/pdf/SkPDFDocument.cpp |
diff --git a/src/pdf/SkPDFDocument.cpp b/src/pdf/SkPDFDocument.cpp |
index c4a5d448a54cc1ca6dd873a4a7737b3095aee7ac..c522b39516ee3cdbfa06458aea3131bb076ab37f 100644 |
--- a/src/pdf/SkPDFDocument.cpp |
+++ b/src/pdf/SkPDFDocument.cpp |
@@ -89,9 +89,13 @@ public: |
: fCat(cat), fOut(out), fBaseOffset(SkToOffT(out->bytesWritten())) { |
} |
- void stream(SkPDFObject* obj) { |
- fCat->setFileOffset(obj, this->offset()); |
- obj->emit(fOut, fCat, true); |
+ void stream(SkPDFObject* object) { |
+ fCat->setFileOffset(object, this->offset()); |
+ SkPDFObject* realObject = fCat->getSubstituteObject(object); |
+ fCat->emitObjectNumber(fOut, realObject); |
+ fOut->writeText(" obj\n"); |
+ realObject->emitObject(fOut, fCat); |
+ fOut->writeText("\nendobj\n"); |
} |
off_t offset() { |