summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render/cpdf_docrenderdata.h
blob: 5daee34176005db2164f5131e2bcb68aeb851e63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2016 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#ifndef CORE_FPDFAPI_RENDER_CPDF_DOCRENDERDATA_H_
#define CORE_FPDFAPI_RENDER_CPDF_DOCRENDERDATA_H_

#include <map>

#include "core/fpdfapi/page/cpdf_countedobject.h"
#include "core/fpdfapi/render/cpdf_transferfunc.h"

class CPDF_Document;
class CPDF_Font;
class CPDF_Object;
class CPDF_Type3Cache;
class CPDF_Type3Font;

class CPDF_DocRenderData {
 public:
  explicit CPDF_DocRenderData(CPDF_Document* pPDFDoc);
  ~CPDF_DocRenderData();

  CPDF_Type3Cache* GetCachedType3(CPDF_Type3Font* pFont);
  void ReleaseCachedType3(CPDF_Type3Font* pFont);

  CFX_RetainPtr<CPDF_TransferFunc> GetTransferFunc(CPDF_Object* pObj);
  void MaybePurgeTransferFunc(CPDF_Object* pOb);

  void Clear(bool bRelease);

 private:
  using CPDF_Type3CacheMap =
      std::map<CPDF_Font*, CPDF_CountedObject<CPDF_Type3Cache>*>;

  CPDF_Document* m_pPDFDoc;  // Not Owned
  CPDF_Type3CacheMap m_Type3FaceMap;
  std::map<CPDF_Object*, CFX_RetainPtr<CPDF_TransferFunc>> m_TransferFuncMap;
};

#endif  // CORE_FPDFAPI_RENDER_CPDF_DOCRENDERDATA_H_