| OLD | NEW | 
|    1 // Copyright 2014 PDFium Authors. All rights reserved. |    1 // Copyright 2014 PDFium Authors. All rights reserved. | 
|    2 // Use of this source code is governed by a BSD-style license that can be |    2 // Use of this source code is governed by a BSD-style license that can be | 
|    3 // found in the LICENSE file. |    3 // found in the LICENSE file. | 
|    4  |    4  | 
|    5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |    5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 
|    6  |    6  | 
|    7 #ifndef CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ |    7 #ifndef CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ | 
|    8 #define CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ |    8 #define CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ | 
|    9  |    9  | 
|   10 #include <map> |   10 #include <map> | 
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  140   void ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y); |  140   void ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y); | 
|  141   void ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y); |  141   void ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y); | 
|  142   void OnChangeTextMatrix(); |  142   void OnChangeTextMatrix(); | 
|  143   uint32_t Parse(const uint8_t* pData, uint32_t dwSize, uint32_t max_cost); |  143   uint32_t Parse(const uint8_t* pData, uint32_t dwSize, uint32_t max_cost); | 
|  144   void ParsePathObject(); |  144   void ParsePathObject(); | 
|  145   void AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag); |  145   void AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag); | 
|  146   void AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_FLOAT w, FX_FLOAT h); |  146   void AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_FLOAT w, FX_FLOAT h); | 
|  147   void AddPathObject(int FillType, FX_BOOL bStroke); |  147   void AddPathObject(int FillType, FX_BOOL bStroke); | 
|  148   CPDF_ImageObject* AddImage(CPDF_Stream* pStream, |  148   CPDF_ImageObject* AddImage(CPDF_Stream* pStream, | 
|  149                              CPDF_Image* pImage, |  149                              CPDF_Image* pImage, | 
|  150                              FX_BOOL bInline); |  150                              bool bInline); | 
|  151   void AddDuplicateImage(); |  151   void AddDuplicateImage(); | 
|  152   void AddForm(CPDF_Stream* pStream); |  152   void AddForm(CPDF_Stream* pStream); | 
|  153   void SetGraphicStates(CPDF_PageObject* pObj, |  153   void SetGraphicStates(CPDF_PageObject* pObj, | 
|  154                         FX_BOOL bColor, |  154                         FX_BOOL bColor, | 
|  155                         FX_BOOL bText, |  155                         FX_BOOL bText, | 
|  156                         FX_BOOL bGraph); |  156                         FX_BOOL bGraph); | 
|  157   void SaveStates(CPDF_AllStates* pState); |  157   void SaveStates(CPDF_AllStates* pState); | 
|  158   void RestoreStates(CPDF_AllStates* pState); |  158   void RestoreStates(CPDF_AllStates* pState); | 
|  159   CPDF_Font* FindFont(const CFX_ByteString& name); |  159   CPDF_Font* FindFont(const CFX_ByteString& name); | 
|  160   CPDF_ColorSpace* FindColorSpace(const CFX_ByteString& name); |  160   CPDF_ColorSpace* FindColorSpace(const CFX_ByteString& name); | 
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  317  |  317  | 
|  318 class CPDF_DocPageData { |  318 class CPDF_DocPageData { | 
|  319  public: |  319  public: | 
|  320   explicit CPDF_DocPageData(CPDF_Document* pPDFDoc); |  320   explicit CPDF_DocPageData(CPDF_Document* pPDFDoc); | 
|  321   ~CPDF_DocPageData(); |  321   ~CPDF_DocPageData(); | 
|  322  |  322  | 
|  323   void Clear(FX_BOOL bRelease = FALSE); |  323   void Clear(FX_BOOL bRelease = FALSE); | 
|  324   CPDF_Font* GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly); |  324   CPDF_Font* GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly); | 
|  325   CPDF_Font* GetStandardFont(const CFX_ByteString& fontName, |  325   CPDF_Font* GetStandardFont(const CFX_ByteString& fontName, | 
|  326                              CPDF_FontEncoding* pEncoding); |  326                              CPDF_FontEncoding* pEncoding); | 
|  327   void ReleaseFont(CPDF_Dictionary* pFontDict); |  327   void ReleaseFont(const CPDF_Dictionary* pFontDict); | 
|  328   CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj, |  328   CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj, | 
|  329                                  const CPDF_Dictionary* pResources); |  329                                  const CPDF_Dictionary* pResources); | 
|  330   CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj); |  330   CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj); | 
|  331   void ReleaseColorSpace(CPDF_Object* pColorSpace); |  331   void ReleaseColorSpace(const CPDF_Object* pColorSpace); | 
|  332   CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj, |  332   CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj, | 
|  333                            FX_BOOL bShading, |  333                            FX_BOOL bShading, | 
|  334                            const CFX_Matrix& matrix); |  334                            const CFX_Matrix& matrix); | 
|  335   void ReleasePattern(CPDF_Object* pPatternObj); |  335   void ReleasePattern(const CPDF_Object* pPatternObj); | 
|  336   CPDF_Image* GetImage(CPDF_Object* pImageStream); |  336   CPDF_Image* GetImage(CPDF_Object* pImageStream); | 
|  337   void ReleaseImage(CPDF_Object* pImageStream); |  337   void ReleaseImage(const CPDF_Object* pImageStream); | 
|  338   CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream); |  338   CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream); | 
|  339   void ReleaseIccProfile(CPDF_IccProfile* pIccProfile); |  339   void ReleaseIccProfile(const CPDF_IccProfile* pIccProfile); | 
|  340   CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream); |  340   CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream); | 
|  341   void ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, |  341   void ReleaseFontFileStreamAcc(const CPDF_Stream* pFontStream); | 
|  342                                 FX_BOOL bForce = FALSE); |  | 
|  343   FX_BOOL IsForceClear() const { return m_bForceClear; } |  342   FX_BOOL IsForceClear() const { return m_bForceClear; } | 
|  344   CPDF_CountedColorSpace* FindColorSpacePtr(CPDF_Object* pCSObj) const; |  343   CPDF_CountedColorSpace* FindColorSpacePtr(CPDF_Object* pCSObj) const; | 
|  345   CPDF_CountedPattern* FindPatternPtr(CPDF_Object* pPatternObj) const; |  344   CPDF_CountedPattern* FindPatternPtr(CPDF_Object* pPatternObj) const; | 
|  346  |  345  | 
|  347  private: |  346  private: | 
|  348   using CPDF_CountedFont = CPDF_CountedObject<CPDF_Font>; |  347   using CPDF_CountedFont = CPDF_CountedObject<CPDF_Font>; | 
|  349   using CPDF_CountedIccProfile = CPDF_CountedObject<CPDF_IccProfile>; |  348   using CPDF_CountedIccProfile = CPDF_CountedObject<CPDF_IccProfile>; | 
|  350   using CPDF_CountedImage = CPDF_CountedObject<CPDF_Image>; |  349   using CPDF_CountedImage = CPDF_CountedObject<CPDF_Image>; | 
|  351   using CPDF_CountedStreamAcc = CPDF_CountedObject<CPDF_StreamAcc>; |  350   using CPDF_CountedStreamAcc = CPDF_CountedObject<CPDF_StreamAcc>; | 
|  352  |  351  | 
|  353   using CPDF_ColorSpaceMap = std::map<CPDF_Object*, CPDF_CountedColorSpace*>; |  352   using CPDF_ColorSpaceMap = | 
|  354   using CPDF_FontFileMap = std::map<CPDF_Stream*, CPDF_CountedStreamAcc*>; |  353       std::map<const CPDF_Object*, CPDF_CountedColorSpace*>; | 
|  355   using CPDF_FontMap = std::map<CPDF_Dictionary*, CPDF_CountedFont*>; |  354   using CPDF_FontFileMap = std::map<const CPDF_Stream*, CPDF_CountedStreamAcc*>; | 
|  356   using CPDF_IccProfileMap = std::map<CPDF_Stream*, CPDF_CountedIccProfile*>; |  355   using CPDF_FontMap = std::map<const CPDF_Dictionary*, CPDF_CountedFont*>; | 
 |  356   using CPDF_IccProfileMap = | 
 |  357       std::map<const CPDF_Stream*, CPDF_CountedIccProfile*>; | 
|  357   using CPDF_ImageMap = std::map<uint32_t, CPDF_CountedImage*>; |  358   using CPDF_ImageMap = std::map<uint32_t, CPDF_CountedImage*>; | 
|  358   using CPDF_PatternMap = std::map<CPDF_Object*, CPDF_CountedPattern*>; |  359   using CPDF_PatternMap = std::map<const CPDF_Object*, CPDF_CountedPattern*>; | 
|  359  |  360  | 
|  360   CPDF_ColorSpace* GetColorSpaceImpl(CPDF_Object* pCSObj, |  361   CPDF_ColorSpace* GetColorSpaceImpl(CPDF_Object* pCSObj, | 
|  361                                      const CPDF_Dictionary* pResources, |  362                                      const CPDF_Dictionary* pResources, | 
|  362                                      std::set<CPDF_Object*>* pVisited); |  363                                      std::set<CPDF_Object*>* pVisited); | 
|  363  |  364  | 
|  364   CPDF_Document* const m_pPDFDoc; |  365   CPDF_Document* const m_pPDFDoc; | 
|  365   FX_BOOL m_bForceClear; |  366   FX_BOOL m_bForceClear; | 
|  366   std::map<CFX_ByteString, CPDF_Stream*> m_HashProfileMap; |  367   std::map<CFX_ByteString, CPDF_Stream*> m_HashProfileMap; | 
|  367   CPDF_ColorSpaceMap m_ColorSpaceMap; |  368   CPDF_ColorSpaceMap m_ColorSpaceMap; | 
|  368   CPDF_FontFileMap m_FontFileMap; |  369   CPDF_FontFileMap m_FontFileMap; | 
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  553 }; |  554 }; | 
|  554  |  555  | 
|  555 CFX_ByteStringC PDF_FindKeyAbbreviationForTesting(const CFX_ByteStringC& abbr); |  556 CFX_ByteStringC PDF_FindKeyAbbreviationForTesting(const CFX_ByteStringC& abbr); | 
|  556 CFX_ByteStringC PDF_FindValueAbbreviationForTesting( |  557 CFX_ByteStringC PDF_FindValueAbbreviationForTesting( | 
|  557     const CFX_ByteStringC& abbr); |  558     const CFX_ByteStringC& abbr); | 
|  558  |  559  | 
|  559 void PDF_ReplaceAbbr(CPDF_Object* pObj); |  560 void PDF_ReplaceAbbr(CPDF_Object* pObj); | 
|  560 bool IsPathOperator(const uint8_t* buf, size_t len); |  561 bool IsPathOperator(const uint8_t* buf, size_t len); | 
|  561  |  562  | 
|  562 #endif  // CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ |  563 #endif  // CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ | 
| OLD | NEW |