PDF: Canon now owns a reference to all interned objects
Add SkPDFCanon::reset function to unref all objects.
No longer possible to remove object from canon
Motivation: this doesn't change these object's lifetime, (they will
still be fully unrefed when SkDocument::close() is called, but we no
longer have to remove them from the array when their destructor is
called.
Review URL: https://codereview.chromium.org/966863002
diff --git a/src/pdf/SkPDFFontImpl.h b/src/pdf/SkPDFFontImpl.h
index 4c3e525..a0689a3 100644
--- a/src/pdf/SkPDFFontImpl.h
+++ b/src/pdf/SkPDFFontImpl.h
@@ -28,8 +28,7 @@
typedef SkPDFDict INHERITED;
#endif
- SkPDFType0Font(SkPDFCanon* canon,
- const SkAdvancedTypefaceMetrics* info,
+ SkPDFType0Font(const SkAdvancedTypefaceMetrics* info,
SkTypeface* typeface);
bool populate(const SkPDFGlyphSet* subset);
@@ -43,8 +42,7 @@
private:
friend class SkPDFType0Font; // to access the constructor
- SkPDFCIDFont(SkPDFCanon* canon,
- const SkAdvancedTypefaceMetrics* info,
+ SkPDFCIDFont(const SkAdvancedTypefaceMetrics* info,
SkTypeface* typeface,
const SkPDFGlyphSet* subset);
@@ -61,8 +59,7 @@
private:
friend class SkPDFFont; // to access the constructor
- SkPDFType1Font(SkPDFCanon* canon,
- const SkAdvancedTypefaceMetrics* info,
+ SkPDFType1Font(const SkAdvancedTypefaceMetrics* info,
SkTypeface* typeface,
uint16_t glyphID,
SkPDFDict* relatedFontDescriptor);
@@ -81,8 +78,7 @@
private:
friend class SkPDFFont; // to access the constructor
- SkPDFType3Font(SkPDFCanon* canon,
- const SkAdvancedTypefaceMetrics* info,
+ SkPDFType3Font(const SkAdvancedTypefaceMetrics* info,
SkTypeface* typeface,
uint16_t glyphID);