In SkPDFDocument::emitPDF(), stop pre-calculating file offsets.
* Add Streamer utility class which measures the current
pdf offset by calling SkWStream::bytesWritten(). Calls
SkPDFCatalog::setFileOffset() and SkPDFObject::emit() at
the same time to guarantee that everything works out.
* SkPDFCatalog::setFileOffset() no longer calculates the
object's size.
* SkPDFCatalog::setSubstituteResourcesOffsets() removed.
* SkPDFCatalog::emitSubstituteResources() removed and
getSubstituteList() made public in its place.
* Remove SkPDFPage::getPageSize and SkPDFPage::emitPage.
Replace with SkPDFPage::getContentStream().
* SkPDFObject::getOutputSize no longer virtual, only used in
unit tests. All SkPDFObject subclasses getOutputSize()
overrides removed.
* SkPDFObject::getIndirectOutputSize removed.
* PDFPrimitivesTest updated for new functions.
Review URL: https://codereview.chromium.org/846023003
diff --git a/src/pdf/SkPDFGraphicState.h b/src/pdf/SkPDFGraphicState.h
index 28686e3..246f1db 100644
--- a/src/pdf/SkPDFGraphicState.h
+++ b/src/pdf/SkPDFGraphicState.h
@@ -39,10 +39,9 @@
virtual void getResources(const SkTSet<SkPDFObject*>& knownResourceObjects,
SkTSet<SkPDFObject*>* newResourceObjects);
- // Override emitObject and getOutputSize so that we can populate
- // the dictionary on demand.
+ // Override emitObject so that we can populate the dictionary on
+ // demand.
virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog);
- virtual size_t getOutputSize(SkPDFCatalog* catalog, bool indirect);
/** Get the graphic state for the passed SkPaint. The reference count of
* the object is incremented and it is the caller's responsibility to