aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFCanon.h
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2016-03-13 18:30:24 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-13 18:30:24 -0700
commit1437c1eea8f40f7a43bfe6e80a8d3f6cd61a3643 (patch)
tree4cdbff97b6e2bf856dff2875ff2c8a818f9b27ea /src/pdf/SkPDFCanon.h
parent1a9b9640843a64af8d9d90337ec3b3fea663196a (diff)
SkPDF: remove all globally references SkPDFObjects
Move these singletons into SkPDFCanon (there is still a single object per document; output PDF size will not change). Motivation: After this change, all indirectly-referenced SkPDFObjects are serialized exactly once. The next CL will add a memory saving feature: a method to purge an object's resources immediately after serialization. After that, further changes wil allow some objects to be serialized *before* SkDocument::close(), leading to potentially very large memory savings. BUG=skia:5087 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1788263002 Review URL: https://codereview.chromium.org/1788263002
Diffstat (limited to 'src/pdf/SkPDFCanon.h')
-rw-r--r--src/pdf/SkPDFCanon.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pdf/SkPDFCanon.h b/src/pdf/SkPDFCanon.h
index 80b1f83e8a..9ca8a261d6 100644
--- a/src/pdf/SkPDFCanon.h
+++ b/src/pdf/SkPDFCanon.h
@@ -84,6 +84,10 @@ public:
SkPixelSerializer* getPixelSerializer() const { return fPixelSerializer.get(); }
void setPixelSerializer(SkPixelSerializer* ps) { fPixelSerializer.reset(ps); }
+ sk_sp<SkPDFStream> makeInvertFunction();
+ sk_sp<SkPDFDict> makeNoSmaskGraphicState();
+ sk_sp<SkPDFArray> makeRangeObject();
+
private:
struct FontRec {
SkPDFFont* fFont;
@@ -119,5 +123,8 @@ private:
SkTHashMap<uint32_t /*ImageUniqueID*/, SkPDFObject*> fPDFBitmapMap;
sk_sp<SkPixelSerializer> fPixelSerializer;
+ sk_sp<SkPDFStream> fInvertFunction;
+ sk_sp<SkPDFDict> fNoSmaskGraphicState;
+ sk_sp<SkPDFArray> fRangeObject;
};
#endif // SkPDFCanon_DEFINED