npm | eadff19 | 2016-09-01 13:21:37 -0700 | [diff] [blame] | 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 | |
dsinclair | 69d9c68 | 2016-10-04 12:18:35 -0700 | [diff] [blame] | 7 | #ifndef CORE_FPDFAPI_RENDER_CPDF_TYPE3CACHE_H_ |
| 8 | #define CORE_FPDFAPI_RENDER_CPDF_TYPE3CACHE_H_ |
npm | eadff19 | 2016-09-01 13:21:37 -0700 | [diff] [blame] | 9 | |
| 10 | #include <map> |
Tom Sepez | 7b9d823 | 2017-04-03 14:53:01 -0700 | [diff] [blame] | 11 | #include <memory> |
npm | eadff19 | 2016-09-01 13:21:37 -0700 | [diff] [blame] | 12 | |
dsinclair | bc5e6d2 | 2016-10-04 11:08:49 -0700 | [diff] [blame] | 13 | #include "core/fpdfapi/font/cpdf_type3font.h" |
dsinclair | a52ab74 | 2016-09-29 13:59:29 -0700 | [diff] [blame] | 14 | #include "core/fxcrt/fx_coordinates.h" |
| 15 | #include "core/fxcrt/fx_string.h" |
| 16 | #include "core/fxcrt/fx_system.h" |
Dan Sinclair | 0b95042 | 2017-09-21 15:49:49 -0400 | [diff] [blame] | 17 | #include "core/fxcrt/retain_ptr.h" |
npm | eadff19 | 2016-09-01 13:21:37 -0700 | [diff] [blame] | 18 | |
| 19 | class CPDF_Type3Glyphs; |
| 20 | |
Dan Sinclair | 0b95042 | 2017-09-21 15:49:49 -0400 | [diff] [blame] | 21 | class CPDF_Type3Cache : public Retainable { |
npm | eadff19 | 2016-09-01 13:21:37 -0700 | [diff] [blame] | 22 | public: |
Tom Sepez | 05e6a80 | 2017-04-03 14:51:26 -0700 | [diff] [blame] | 23 | template <typename T, typename... Args> |
Dan Sinclair | 0b95042 | 2017-09-21 15:49:49 -0400 | [diff] [blame] | 24 | friend RetainPtr<T> pdfium::MakeRetain(Args&&... args); |
npm | eadff19 | 2016-09-01 13:21:37 -0700 | [diff] [blame] | 25 | |
| 26 | CFX_GlyphBitmap* LoadGlyph(uint32_t charcode, |
| 27 | const CFX_Matrix* pMatrix, |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 28 | float retinaScaleX, |
| 29 | float retinaScaleY); |
npm | eadff19 | 2016-09-01 13:21:37 -0700 | [diff] [blame] | 30 | |
| 31 | private: |
Tom Sepez | 05e6a80 | 2017-04-03 14:51:26 -0700 | [diff] [blame] | 32 | explicit CPDF_Type3Cache(CPDF_Type3Font* pFont); |
| 33 | ~CPDF_Type3Cache() override; |
| 34 | |
Tom Sepez | 0748d3c | 2017-04-21 13:10:34 -0700 | [diff] [blame] | 35 | std::unique_ptr<CFX_GlyphBitmap> RenderGlyph(CPDF_Type3Glyphs* pSize, |
| 36 | uint32_t charcode, |
| 37 | const CFX_Matrix* pMatrix, |
| 38 | float retinaScaleX, |
| 39 | float retinaScaleY); |
npm | eadff19 | 2016-09-01 13:21:37 -0700 | [diff] [blame] | 40 | |
Dan Sinclair | aee0db0 | 2017-09-21 16:53:58 -0400 | [diff] [blame^] | 41 | UnownedPtr<CPDF_Type3Font> const m_pFont; |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 42 | std::map<ByteString, std::unique_ptr<CPDF_Type3Glyphs>> m_SizeMap; |
npm | eadff19 | 2016-09-01 13:21:37 -0700 | [diff] [blame] | 43 | }; |
| 44 | |
dsinclair | 69d9c68 | 2016-10-04 12:18:35 -0700 | [diff] [blame] | 45 | #endif // CORE_FPDFAPI_RENDER_CPDF_TYPE3CACHE_H_ |