diff options
author | npm <npm@chromium.org> | 2016-11-17 10:47:43 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-17 10:47:43 -0800 |
commit | 935c6310adacf2f4a4265e831e6cb60dc7a35803 (patch) | |
tree | 77f069eb3f7e9f45ffdf58dd11a9b12196515a93 /core/fpdfapi/render/cpdf_docrenderdata.h | |
parent | b977720aa7f159ae2c1e9d9b3af1adecff730545 (diff) | |
download | pdfium-935c6310adacf2f4a4265e831e6cb60dc7a35803.tar.xz |
Move CPDF_DocRenderData from render_int
First CL in an attempt to reduce the class cluttering in
fpdf_render_text, fpdf_render_image, and fpdf_render.
Review-Url: https://codereview.chromium.org/2507023006
Diffstat (limited to 'core/fpdfapi/render/cpdf_docrenderdata.h')
-rw-r--r-- | core/fpdfapi/render/cpdf_docrenderdata.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/core/fpdfapi/render/cpdf_docrenderdata.h b/core/fpdfapi/render/cpdf_docrenderdata.h new file mode 100644 index 0000000000..a8f4167a8d --- /dev/null +++ b/core/fpdfapi/render/cpdf_docrenderdata.h @@ -0,0 +1,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" + +class CPDF_Document; +class CPDF_Font; +class CPDF_Object; +class CPDF_TransferFunc; +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); + CPDF_TransferFunc* GetTransferFunc(CPDF_Object* pObj); + void ReleaseTransferFunc(CPDF_Object* pObj); + void Clear(bool bRelease); + + private: + using CPDF_Type3CacheMap = + std::map<CPDF_Font*, CPDF_CountedObject<CPDF_Type3Cache>*>; + using CPDF_TransferFuncMap = + std::map<CPDF_Object*, CPDF_CountedObject<CPDF_TransferFunc>*>; + + CPDF_Document* m_pPDFDoc; // Not Owned + CPDF_Type3CacheMap m_Type3FaceMap; + CPDF_TransferFuncMap m_TransferFuncMap; +}; + +#endif // CORE_FPDFAPI_RENDER_CPDF_DOCRENDERDATA_H_ |