SkPDF: Simplify PDFStream / emitObject() const
Compress SkPDFStream's data on setData(), not emitObject(); no longer stateful.
SkPDFObject::emitObject is now const. This makes it easier to reason about state.
Minimal performance gains.
Review URL: https://codereview.chromium.org/1304493002
diff --git a/src/pdf/SkPDFGraphicState.h b/src/pdf/SkPDFGraphicState.h
index 1b11fe4..45a32d4 100644
--- a/src/pdf/SkPDFGraphicState.h
+++ b/src/pdf/SkPDFGraphicState.h
@@ -32,9 +32,9 @@
// Override emitObject so that we can populate the dictionary on
// demand.
- virtual void emitObject(SkWStream* stream,
- const SkPDFObjNumMap& objNumMap,
- const SkPDFSubstituteMap& substitutes);
+ void emitObject(SkWStream* stream,
+ const SkPDFObjNumMap& objNumMap,
+ const SkPDFSubstituteMap& substitutes) const override;
/** Get the graphic state for the passed SkPaint. The reference count of
* the object is incremented and it is the caller's responsibility to