• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The PDFium Authors
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_CFX_FONTCACHE_H_
8 #define CORE_FXGE_CFX_FONTCACHE_H_
9 
10 #include <map>
11 
12 #include "core/fxcrt/fx_system.h"
13 #include "core/fxcrt/retain_ptr.h"
14 #include "core/fxge/cfx_glyphcache.h"
15 
16 class CFX_Font;
17 
18 class CFX_FontCache {
19  public:
20   CFX_FontCache();
21   ~CFX_FontCache();
22 
23   RetainPtr<CFX_GlyphCache> GetGlyphCache(const CFX_Font* pFont);
24 #if defined(PDF_USE_SKIA)
25   CFX_TypeFace* GetDeviceCache(const CFX_Font* pFont);
26 #endif
27 
28  private:
29   std::map<CFX_Face*, ObservedPtr<CFX_GlyphCache>> m_GlyphCacheMap;
30   std::map<CFX_Face*, ObservedPtr<CFX_GlyphCache>> m_ExtGlyphCacheMap;
31 };
32 
33 #endif  // CORE_FXGE_CFX_FONTCACHE_H_
34