From 47228aceb86744f858ab8bfa98f3f8b62054dfae Mon Sep 17 00:00:00 2001 From: weili Date: Wed, 20 Jul 2016 10:35:31 -0700 Subject: Clean up singleton implementation Move the singleton instances into their namespaces, and use get()/getInstance() for uniform accesses. Review-Url: https://codereview.chromium.org/2154843002 --- core/fxge/include/fx_ge.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'core/fxge/include') diff --git a/core/fxge/include/fx_ge.h b/core/fxge/include/fx_ge.h index ea2adec1dc..dbc4fd0a43 100644 --- a/core/fxge/include/fx_ge.h +++ b/core/fxge/include/fx_ge.h @@ -23,11 +23,10 @@ class SkPictureRecorder; class CFX_GEModule { public: - static void Create(const char** pUserFontPaths, - CCodec_ModuleMgr* pCodecModule); static CFX_GEModule* Get(); static void Destroy(); + void Init(const char** pUserFontPaths, CCodec_ModuleMgr* pCodecModule); CFX_FontCache* GetFontCache(); CFX_FontMgr* GetFontMgr() { return m_pFontMgr.get(); } void SetTextGamma(FX_FLOAT gammaValue); @@ -39,7 +38,7 @@ class CFX_GEModule { FXFT_Library m_FTLibrary; private: - CFX_GEModule(const char** pUserFontPaths, CCodec_ModuleMgr* pCodecModule); + CFX_GEModule(); ~CFX_GEModule(); void InitPlatform(); @@ -48,7 +47,7 @@ class CFX_GEModule { uint8_t m_GammaValue[256]; CFX_FontCache* m_pFontCache; std::unique_ptr m_pFontMgr; - CCodec_ModuleMgr* const m_pCodecModule; + CCodec_ModuleMgr* m_pCodecModule; void* m_pPlatformData; const char** m_pUserFontPaths; }; -- cgit v1.2.3