diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-05-11 14:36:10 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-11 19:10:43 +0000 |
commit | 830897a1774fb50d04b656d7bf70be321e133cf9 (patch) | |
tree | bd5473e87f1246c8bdc9c224342637160d70da55 /core/fxge | |
parent | dbc3d3e1e0b28692c31f08f6b4c606577255078d (diff) | |
download | pdfium-830897a1774fb50d04b656d7bf70be321e133cf9.tar.xz |
Move map and codec loading into manager
This Cl consolidates the code to load maps and codecs into the
CPDF_ModuleMgr class instead of putting it directly into fpdfview.
Change-Id: Ia08f212f43a33e51ab1c7832051ee4f28eecb50d
Reviewed-on: https://pdfium-review.googlesource.com/5335
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxge')
-rw-r--r-- | core/fxge/cfx_gemodule.h | 8 | ||||
-rw-r--r-- | core/fxge/ge/cfx_gemodule.cpp | 10 |
2 files changed, 7 insertions, 11 deletions
diff --git a/core/fxge/cfx_gemodule.h b/core/fxge/cfx_gemodule.h index 4dfa413437..e51ddde967 100644 --- a/core/fxge/cfx_gemodule.h +++ b/core/fxge/cfx_gemodule.h @@ -21,17 +21,15 @@ class CFX_GEModule { static CFX_GEModule* Get(); static void Destroy(); - void Init(const char** pUserFontPaths, CCodec_ModuleMgr* pCodecModule); + void Init(const char** pUserFontPaths); CFX_FontCache* GetFontCache(); CFX_FontMgr* GetFontMgr() { return m_pFontMgr.get(); } void SetTextGamma(float gammaValue); const uint8_t* GetTextGammaTable() const; - CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule; } + CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule.get(); } void* GetPlatformData() { return m_pPlatformData; } - FXFT_Library m_FTLibrary; - private: CFX_GEModule(); ~CFX_GEModule(); @@ -42,7 +40,7 @@ class CFX_GEModule { uint8_t m_GammaValue[256]; std::unique_ptr<CFX_FontCache> m_pFontCache; std::unique_ptr<CFX_FontMgr> m_pFontMgr; - CCodec_ModuleMgr* m_pCodecModule; + std::unique_ptr<CCodec_ModuleMgr> m_pCodecModule; void* m_pPlatformData; const char** m_pUserFontPaths; }; diff --git a/core/fxge/ge/cfx_gemodule.cpp b/core/fxge/ge/cfx_gemodule.cpp index 125758b6ad..2cd1e31144 100644 --- a/core/fxge/ge/cfx_gemodule.cpp +++ b/core/fxge/ge/cfx_gemodule.cpp @@ -6,6 +6,7 @@ #include "core/fxge/cfx_gemodule.h" +#include "core/fxcodec/fx_codec.h" #include "core/fxge/cfx_fontcache.h" #include "core/fxge/cfx_fontmgr.h" #include "core/fxge/ge/cfx_folderfontinfo.h" @@ -19,9 +20,8 @@ CFX_GEModule* g_pGEModule = nullptr; } // namespace CFX_GEModule::CFX_GEModule() - : m_FTLibrary(nullptr), - m_pFontMgr(new CFX_FontMgr), - m_pCodecModule(nullptr), + : m_pFontMgr(pdfium::MakeUnique<CFX_FontMgr>()), + m_pCodecModule(pdfium::MakeUnique<CCodec_ModuleMgr>()), m_pPlatformData(nullptr), m_pUserFontPaths(nullptr) {} @@ -43,10 +43,8 @@ void CFX_GEModule::Destroy() { g_pGEModule = nullptr; } -void CFX_GEModule::Init(const char** userFontPaths, - CCodec_ModuleMgr* pCodecModule) { +void CFX_GEModule::Init(const char** userFontPaths) { ASSERT(g_pGEModule); - m_pCodecModule = pCodecModule; m_pUserFontPaths = userFontPaths; InitPlatform(); SetTextGamma(2.2f); |