OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/fxge/include/cfx_fontcache.h" | 7 #include "core/fxge/include/cfx_fontcache.h" |
8 | 8 |
| 9 #include "core/fxge/include/cfx_facecache.h" |
9 #include "core/fxge/include/fx_font.h" | 10 #include "core/fxge/include/fx_font.h" |
10 #include "core/fxge/include/fx_freetype.h" | 11 #include "core/fxge/include/fx_freetype.h" |
11 | 12 |
12 CFX_FontCache::CFX_FontCache() {} | 13 CFX_FontCache::CFX_FontCache() {} |
13 | 14 |
14 CFX_FontCache::~CFX_FontCache() { | 15 CFX_FontCache::~CFX_FontCache() { |
15 FreeCache(TRUE); | 16 FreeCache(TRUE); |
16 } | 17 } |
17 | 18 |
18 CFX_FaceCache* CFX_FontCache::GetCachedFace(CFX_Font* pFont) { | 19 CFX_FaceCache* CFX_FontCache::GetCachedFace(CFX_Font* pFont) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 for (auto it = m_ExtFaceMap.begin(); it != m_ExtFaceMap.end();) { | 70 for (auto it = m_ExtFaceMap.begin(); it != m_ExtFaceMap.end();) { |
70 auto curr_it = it++; | 71 auto curr_it = it++; |
71 CFX_CountedFaceCache* cache = curr_it->second; | 72 CFX_CountedFaceCache* cache = curr_it->second; |
72 if (bRelease || cache->m_nCount < 2) { | 73 if (bRelease || cache->m_nCount < 2) { |
73 delete cache->m_Obj; | 74 delete cache->m_Obj; |
74 delete cache; | 75 delete cache; |
75 m_ExtFaceMap.erase(curr_it); | 76 m_ExtFaceMap.erase(curr_it); |
76 } | 77 } |
77 } | 78 } |
78 } | 79 } |
OLD | NEW |