summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_docpagedata.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-03-31 17:10:34 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-01 02:37:29 +0000
commit7d4f6a89d7e2c5d13b7d630d6348950044a5465e (patch)
tree3e0d95ba83fb471ef6d5a9cfde5a4d8bfd103471 /core/fpdfapi/page/cpdf_docpagedata.h
parent984f1d877ac59315f4c070b1d63c9f651221760b (diff)
downloadpdfium-7d4f6a89d7e2c5d13b7d630d6348950044a5465e.tar.xz
Refcount CPDF_Image all the time.chromium/3061chromium/3060
Remove the old externally-counted CPDF_CountedImage type. Change-Id: Ia0b288586272da3f2daf7dfc153f08e62794321a Reviewed-on: https://pdfium-review.googlesource.com/3553 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_docpagedata.h')
-rw-r--r--core/fpdfapi/page/cpdf_docpagedata.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/core/fpdfapi/page/cpdf_docpagedata.h b/core/fpdfapi/page/cpdf_docpagedata.h
index 37538eb329..6ce6985e09 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.h
+++ b/core/fpdfapi/page/cpdf_docpagedata.h
@@ -30,32 +30,38 @@ class CPDF_DocPageData {
~CPDF_DocPageData();
void Clear(bool bRelease = false);
+ bool IsForceClear() const { return m_bForceClear; }
+
CPDF_Font* GetFont(CPDF_Dictionary* pFontDict);
CPDF_Font* GetStandardFont(const CFX_ByteString& fontName,
CPDF_FontEncoding* pEncoding);
void ReleaseFont(const CPDF_Dictionary* pFontDict);
+
CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj,
const CPDF_Dictionary* pResources);
CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj);
void ReleaseColorSpace(const CPDF_Object* pColorSpace);
+
CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj,
bool bShading,
const CFX_Matrix& matrix);
void ReleasePattern(const CPDF_Object* pPatternObj);
- CPDF_Image* GetImage(uint32_t dwStreamObjNum);
- void ReleaseImage(uint32_t dwStreamObjNum);
+
+ CFX_RetainPtr<CPDF_Image> GetImage(uint32_t dwStreamObjNum);
+ void MaybePurgeImage(uint32_t dwStreamObjNum);
+
CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream);
void ReleaseIccProfile(const CPDF_IccProfile* pIccProfile);
+
CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream);
void ReleaseFontFileStreamAcc(const CPDF_Stream* pFontStream);
- bool IsForceClear() const { return m_bForceClear; }
+
CPDF_CountedColorSpace* FindColorSpacePtr(CPDF_Object* pCSObj) const;
CPDF_CountedPattern* FindPatternPtr(CPDF_Object* pPatternObj) const;
private:
using CPDF_CountedFont = CPDF_CountedObject<CPDF_Font>;
using CPDF_CountedIccProfile = CPDF_CountedObject<CPDF_IccProfile>;
- using CPDF_CountedImage = CPDF_CountedObject<CPDF_Image>;
using CPDF_CountedStreamAcc = CPDF_CountedObject<CPDF_StreamAcc>;
using CPDF_ColorSpaceMap =
@@ -64,7 +70,7 @@ class CPDF_DocPageData {
using CPDF_FontMap = std::map<const CPDF_Dictionary*, CPDF_CountedFont*>;
using CPDF_IccProfileMap =
std::map<const CPDF_Stream*, CPDF_CountedIccProfile*>;
- using CPDF_ImageMap = std::map<uint32_t, CPDF_CountedImage*>;
+ using CPDF_ImageMap = std::map<uint32_t, CFX_RetainPtr<CPDF_Image>>;
using CPDF_PatternMap = std::map<const CPDF_Object*, CPDF_CountedPattern*>;
CPDF_ColorSpace* GetColorSpaceImpl(CPDF_Object* pCSObj,