From 2e3f9d8a9309686eeb4c76ccfde5800da87a68b3 Mon Sep 17 00:00:00 2001 From: halcanary Date: Fri, 27 Feb 2015 12:41:03 -0800 Subject: 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 --- src/pdf/SkPDFShader.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/pdf/SkPDFShader.h') diff --git a/src/pdf/SkPDFShader.h b/src/pdf/SkPDFShader.h index 5be47a382f..4fdbc44cf7 100644 --- a/src/pdf/SkPDFShader.h +++ b/src/pdf/SkPDFShader.h @@ -61,10 +61,9 @@ public: bool equals(const SkPDFShader::State&) const; private: - SkPDFCanon* fCanon; SkAutoTDelete fShaderState; SkTDArray fResources; - SkPDFFunctionShader(SkPDFCanon*, SkPDFShader::State*); + SkPDFFunctionShader(SkPDFShader::State*); typedef SkPDFDict INHERITED; }; @@ -82,11 +81,10 @@ public: bool equals(const SkPDFShader::State&) const; private: - SkPDFCanon* fCanon; SkAutoTDelete fShaderState; SkAutoTUnref fColorShader; SkAutoTUnref fResourceDict; - SkPDFAlphaFunctionShader(SkPDFCanon*, SkPDFShader::State*); + SkPDFAlphaFunctionShader(SkPDFShader::State*); }; class SkPDFImageShader : public SkPDFStream { @@ -98,10 +96,9 @@ public: bool equals(const SkPDFShader::State&) const; private: - SkPDFCanon* fCanon; SkAutoTDelete fShaderState; SkTSet fResources; - SkPDFImageShader(SkPDFCanon*, SkPDFShader::State*); + SkPDFImageShader(SkPDFShader::State*); }; #endif -- cgit v1.2.3