diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-31 14:28:22 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-31 14:28:22 -0700 |
commit | d1e6a3f6d95e37cae3caf40bca0a0aacf8d0e223 (patch) | |
tree | 026a29006e05599bd9a407b452bbdc7f74eccb5f /core/src | |
parent | f4bef481c86e6ee21d25a350061caff82d57df7b (diff) | |
download | pdfium-d1e6a3f6d95e37cae3caf40bca0a0aacf8d0e223.tar.xz |
Merge to XFA: Kill IFX_FontMapper
(cherry picked from commit 01fa1efb228acdcf5250804c670107133668e4b2)
Orignal Review URL: https://codereview.chromium.org/1259123005 .
conflicts:
core/include/fxge/fx_font.h
core/src/fxge/ge/fx_ge_fontmap.cpp
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1262723006 .
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/fxge/apple/apple_int.h | 12 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge.cpp | 5 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_fontmap.cpp | 31 |
3 files changed, 12 insertions, 36 deletions
diff --git a/core/src/fxge/apple/apple_int.h b/core/src/fxge/apple/apple_int.h index 715e48d6c2..090ac0924a 100644 --- a/core/src/fxge/apple/apple_int.h +++ b/core/src/fxge/apple/apple_int.h @@ -65,16 +65,10 @@ public: class CApplePlatform { public: - CApplePlatform() - { - m_pFontMapper = NULL; - } - ~CApplePlatform() - { - delete m_pFontMapper; - } + CApplePlatform() {} + ~CApplePlatform() {} + CQuartz2D _quartz2d; - IFX_FontMapper* m_pFontMapper; }; class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { diff --git a/core/src/fxge/ge/fx_ge.cpp b/core/src/fxge/ge/fx_ge.cpp index 8c2a4378da..8167a912af 100644 --- a/core/src/fxge/ge/fx_ge.cpp +++ b/core/src/fxge/ge/fx_ge.cpp @@ -66,8 +66,3 @@ const uint8_t* CFX_GEModule::GetTextGammaTable() { return m_GammaValue; } -void CFX_GEModule::SetExtFontMapper(IFX_FontMapper* pFontMapper) -{ - GetFontMgr()->m_pExtMapper = pFontMapper; - pFontMapper->m_pFontMgr = m_pFontMgr; -} diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index 8b1342954a..89988189ec 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -61,15 +61,9 @@ int32_t CTTFontDesc::ReleaseFace(FXFT_Face face) delete this; return 0; } -CFX_FontMgr::CFX_FontMgr() +CFX_FontMgr::CFX_FontMgr() : m_FTLibrary(nullptr) { - m_pBuiltinMapper = FX_NEW CFX_FontMapper; - if (!m_pBuiltinMapper) { - return; - } - m_pBuiltinMapper->m_pFontMgr = this; - m_pExtMapper = NULL; - m_FTLibrary = NULL; + m_pBuiltinMapper = new CFX_FontMapper(this); FXSYS_memset(m_ExternalFonts, 0, sizeof m_ExternalFonts); } CFX_FontMgr::~CFX_FontMgr() @@ -104,18 +98,10 @@ void CFX_FontMgr::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags, int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont) { - if (m_FTLibrary == NULL) { + if (!m_FTLibrary) { FXFT_Init_FreeType(&m_FTLibrary); } - if (m_pExtMapper) { - FXFT_Face face = m_pExtMapper->FindSubstFont(face_name, bTrueType, flags, weight, italic_angle, - CharsetCP, pSubstFont); - if (face) { - return face; - } - } - return m_pBuiltinMapper->FindSubstFont(face_name, bTrueType, flags, weight, italic_angle, - CharsetCP, pSubstFont); + return m_pBuiltinMapper->FindSubstFont(face_name, bTrueType, flags, weight, italic_angle, CharsetCP, pSubstFont); } FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name, int weight, FX_BOOL bItalic, uint8_t*& pFontData) @@ -471,13 +457,14 @@ FX_BOOL CFX_FontMgr::GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, } return TRUE; } -CFX_FontMapper::CFX_FontMapper() +CFX_FontMapper::CFX_FontMapper(CFX_FontMgr* mgr) + : m_pFontInfo(nullptr), + m_bListLoaded(FALSE), + m_pFontEnumerator(nullptr), + m_pFontMgr(mgr) { FXSYS_memset(m_FoxitFaces, 0, sizeof m_FoxitFaces); m_MMFaces[0] = m_MMFaces[1] = NULL; - m_pFontInfo = NULL; - m_bListLoaded = FALSE; - m_pFontEnumerator = NULL; } CFX_FontMapper::~CFX_FontMapper() { |