OLD | NEW |
| (Empty) |
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_FXGE_INCLUDE_CFX_FACECACHE_H_ | |
8 #define CORE_FXGE_INCLUDE_CFX_FACECACHE_H_ | |
9 | |
10 #include <map> | |
11 | |
12 #include "core/fxge/include/fx_font.h" | |
13 #include "core/fxge/include/fx_freetype.h" | |
14 | |
15 class CFX_FaceCache { | |
16 public: | |
17 explicit CFX_FaceCache(FXFT_Face face); | |
18 ~CFX_FaceCache(); | |
19 const CFX_GlyphBitmap* LoadGlyphBitmap(const CFX_Font* pFont, | |
20 uint32_t glyph_index, | |
21 FX_BOOL bFontStyle, | |
22 const CFX_Matrix* pMatrix, | |
23 int dest_width, | |
24 int anti_alias, | |
25 int& text_flags); | |
26 const CFX_PathData* LoadGlyphPath(const CFX_Font* pFont, | |
27 uint32_t glyph_index, | |
28 int dest_width); | |
29 | |
30 #ifdef _SKIA_SUPPORT_ | |
31 CFX_TypeFace* GetDeviceCache(const CFX_Font* pFont); | |
32 #endif | |
33 | |
34 private: | |
35 CFX_GlyphBitmap* RenderGlyph(const CFX_Font* pFont, | |
36 uint32_t glyph_index, | |
37 FX_BOOL bFontStyle, | |
38 const CFX_Matrix* pMatrix, | |
39 int dest_width, | |
40 int anti_alias); | |
41 CFX_GlyphBitmap* RenderGlyph_Nativetext(const CFX_Font* pFont, | |
42 uint32_t glyph_index, | |
43 const CFX_Matrix* pMatrix, | |
44 int dest_width, | |
45 int anti_alias); | |
46 CFX_GlyphBitmap* LookUpGlyphBitmap(const CFX_Font* pFont, | |
47 const CFX_Matrix* pMatrix, | |
48 const CFX_ByteString& FaceGlyphsKey, | |
49 uint32_t glyph_index, | |
50 FX_BOOL bFontStyle, | |
51 int dest_width, | |
52 int anti_alias); | |
53 void InitPlatform(); | |
54 void DestroyPlatform(); | |
55 | |
56 FXFT_Face const m_Face; | |
57 std::map<CFX_ByteString, std::unique_ptr<CFX_SizeGlyphCache>> m_SizeMap; | |
58 std::map<uint32_t, std::unique_ptr<CFX_PathData>> m_PathMap; | |
59 #ifdef _SKIA_SUPPORT_ | |
60 CFX_TypeFace* m_pTypeface; | |
61 #endif | |
62 }; | |
63 | |
64 #endif // CORE_FXGE_INCLUDE_CFX_FACECACHE_H_ | |
OLD | NEW |