Home | History | Annotate | Download | only in render
      1 // Copyright 2016 PDFium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
      6 
      7 #ifndef CORE_FPDFAPI_RENDER_CPDF_DOCRENDERDATA_H_
      8 #define CORE_FPDFAPI_RENDER_CPDF_DOCRENDERDATA_H_
      9 
     10 #include <map>
     11 
     12 #include "core/fpdfapi/page/cpdf_countedobject.h"
     13 #include "core/fpdfapi/render/cpdf_transferfunc.h"
     14 #include "core/fxcrt/fx_system.h"
     15 #include "core/fxcrt/unowned_ptr.h"
     16 
     17 class CPDF_Document;
     18 class CPDF_Font;
     19 class CPDF_Object;
     20 class CPDF_Type3Cache;
     21 class CPDF_Type3Font;
     22 
     23 class CPDF_DocRenderData {
     24  public:
     25   explicit CPDF_DocRenderData(CPDF_Document* pPDFDoc);
     26   ~CPDF_DocRenderData();
     27 
     28   RetainPtr<CPDF_Type3Cache> GetCachedType3(CPDF_Type3Font* pFont);
     29   void MaybePurgeCachedType3(CPDF_Type3Font* pFont);
     30 
     31   RetainPtr<CPDF_TransferFunc> GetTransferFunc(CPDF_Object* pObj);
     32   void MaybePurgeTransferFunc(CPDF_Object* pOb);
     33 
     34   void Clear(bool bRelease);
     35 
     36  private:
     37   UnownedPtr<CPDF_Document> m_pPDFDoc;
     38   std::map<CPDF_Font*, RetainPtr<CPDF_Type3Cache>> m_Type3FaceMap;
     39   std::map<CPDF_Object*, RetainPtr<CPDF_TransferFunc>> m_TransferFuncMap;
     40 };
     41 
     42 #endif  // CORE_FPDFAPI_RENDER_CPDF_DOCRENDERDATA_H_
     43