blob: ab748ba9896364e1a5bcdb71547cb91d752a395b [file] [log] [blame]
npmeadff192016-09-01 13:21:37 -07001// 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
dsinclair69d9c682016-10-04 12:18:35 -07007#ifndef CORE_FPDFAPI_RENDER_CPDF_TYPE3CACHE_H_
8#define CORE_FPDFAPI_RENDER_CPDF_TYPE3CACHE_H_
npmeadff192016-09-01 13:21:37 -07009
10#include <map>
Tom Sepez7b9d8232017-04-03 14:53:01 -070011#include <memory>
npmeadff192016-09-01 13:21:37 -070012
dsinclairbc5e6d22016-10-04 11:08:49 -070013#include "core/fpdfapi/font/cpdf_type3font.h"
Tom Sepez05e6a802017-04-03 14:51:26 -070014#include "core/fxcrt/cfx_retain_ptr.h"
dsinclaira52ab742016-09-29 13:59:29 -070015#include "core/fxcrt/fx_coordinates.h"
16#include "core/fxcrt/fx_string.h"
17#include "core/fxcrt/fx_system.h"
npmeadff192016-09-01 13:21:37 -070018
19class CPDF_Type3Glyphs;
20
Tom Sepez05e6a802017-04-03 14:51:26 -070021class CPDF_Type3Cache : public CFX_Retainable {
npmeadff192016-09-01 13:21:37 -070022 public:
Tom Sepez05e6a802017-04-03 14:51:26 -070023 template <typename T, typename... Args>
24 friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args);
npmeadff192016-09-01 13:21:37 -070025
26 CFX_GlyphBitmap* LoadGlyph(uint32_t charcode,
27 const CFX_Matrix* pMatrix,
Dan Sinclair05df0752017-03-14 14:43:42 -040028 float retinaScaleX,
29 float retinaScaleY);
npmeadff192016-09-01 13:21:37 -070030
31 private:
Tom Sepez05e6a802017-04-03 14:51:26 -070032 explicit CPDF_Type3Cache(CPDF_Type3Font* pFont);
33 ~CPDF_Type3Cache() override;
34
Tom Sepez0748d3c2017-04-21 13:10:34 -070035 std::unique_ptr<CFX_GlyphBitmap> RenderGlyph(CPDF_Type3Glyphs* pSize,
36 uint32_t charcode,
37 const CFX_Matrix* pMatrix,
38 float retinaScaleX,
39 float retinaScaleY);
npmeadff192016-09-01 13:21:37 -070040
Tom Sepez797ca5c2017-05-25 12:03:18 -070041 CFX_UnownedPtr<CPDF_Type3Font> const m_pFont;
Ryan Harrison275e2602017-09-18 14:23:18 -040042 std::map<ByteString, std::unique_ptr<CPDF_Type3Glyphs>> m_SizeMap;
npmeadff192016-09-01 13:21:37 -070043};
44
dsinclair69d9c682016-10-04 12:18:35 -070045#endif // CORE_FPDFAPI_RENDER_CPDF_TYPE3CACHE_H_