From 0b95042db2e6dab5876abd12ce485fff0a8e08fe Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 21 Sep 2017 15:49:49 -0400 Subject: Rename CFX_RetainPtr to RetainPtr This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e Reviewed-on: https://pdfium-review.googlesource.com/14616 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- xfa/fgas/font/cfgas_gefont.h | 46 +++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 24 deletions(-) (limited to 'xfa/fgas/font/cfgas_gefont.h') diff --git a/xfa/fgas/font/cfgas_gefont.h b/xfa/fgas/font/cfgas_gefont.h index c83fc4319d..f88f8b4cd9 100644 --- a/xfa/fgas/font/cfgas_gefont.h +++ b/xfa/fgas/font/cfgas_gefont.h @@ -11,9 +11,9 @@ #include #include -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_memory.h" +#include "core/fxcrt/retain_ptr.h" #include "xfa/fgas/font/cfgas_fontmgr.h" #include "xfa/fgas/font/cfgas_pdffontmgr.h" @@ -22,25 +22,24 @@ class CFGAS_FontMgr; class CFX_UnicodeEncoding; -class CFGAS_GEFont : public CFX_Retainable { +class CFGAS_GEFont : public Retainable { public: template - friend class CFX_RetainPtr; + friend class RetainPtr; template - friend CFX_RetainPtr pdfium::MakeRetain(Args&&... args); + friend RetainPtr pdfium::MakeRetain(Args&&... args); - static CFX_RetainPtr LoadFont(const wchar_t* pszFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage, - CFGAS_FontMgr* pFontMgr); - static CFX_RetainPtr LoadFont(CFX_Font* pExternalFont, - CFGAS_FontMgr* pFontMgr); - static CFX_RetainPtr LoadFont( + static RetainPtr LoadFont(const wchar_t* pszFontFamily, + uint32_t dwFontStyles, + uint16_t wCodePage, + CFGAS_FontMgr* pFontMgr); + static RetainPtr LoadFont(CFX_Font* pExternalFont, + CFGAS_FontMgr* pFontMgr); + static RetainPtr LoadFont( std::unique_ptr pInternalFont, CFGAS_FontMgr* pFontMgr); - CFX_RetainPtr Derive(uint32_t dwFontStyles, - uint16_t wCodePage = 0); + RetainPtr Derive(uint32_t dwFontStyles, uint16_t wCodePage = 0); uint32_t GetFontStyles() const; bool GetCharWidth(wchar_t wUnicode, int32_t& iWidth, bool bCharCode); int32_t GetGlyphIndex(wchar_t wUnicode, bool bCharCode = false); @@ -48,7 +47,7 @@ class CFGAS_GEFont : public CFX_Retainable { int32_t GetDescent() const; bool GetCharBBox(wchar_t wUnicode, CFX_Rect* bbox, bool bCharCode = false); bool GetBBox(CFX_Rect* bbox); - CFX_RetainPtr GetSubstFont(int32_t iGlyphIndex); + RetainPtr GetSubstFont(int32_t iGlyphIndex); CFX_Font* GetDevFont() const { return m_pFont; } void SetFontProvider(CFGAS_PDFFontMgr* pProvider) { m_pProvider.Reset(pProvider); @@ -62,7 +61,7 @@ class CFGAS_GEFont : public CFX_Retainable { private: explicit CFGAS_GEFont(CFGAS_FontMgr* pFontMgr); - CFGAS_GEFont(const CFX_RetainPtr& src, uint32_t dwFontStyles); + CFGAS_GEFont(const RetainPtr& src, uint32_t dwFontStyles); ~CFGAS_GEFont() override; #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ @@ -70,9 +69,8 @@ class CFGAS_GEFont : public CFX_Retainable { uint32_t dwFontStyles, uint16_t wCodePage); bool LoadFontInternal(const uint8_t* pBuffer, int32_t length); - bool LoadFontInternal( - const CFX_RetainPtr& pFontStream, - bool bSaveStream); + bool LoadFontInternal(const RetainPtr& pFontStream, + bool bSaveStream); #endif bool LoadFontInternal(CFX_Font* pExternalFont); bool LoadFontInternal(std::unique_ptr pInternalFont); @@ -87,7 +85,7 @@ class CFGAS_GEFont : public CFX_Retainable { bool bCharCode); int32_t GetGlyphIndex(wchar_t wUnicode, bool bRecursive, - CFX_RetainPtr* ppFont, + RetainPtr* ppFont, bool bCharCode = false); WideString GetFamilyName() const; @@ -97,16 +95,16 @@ class CFGAS_GEFont : public CFX_Retainable { #endif CFX_Font* m_pFont; bool m_bExternalFont; - CFX_RetainPtr m_pSrcFont; // Only set by ctor, so no cycles. + RetainPtr m_pSrcFont; // Only set by ctor, so no cycles. CFGAS_FontMgr::ObservedPtr m_pFontMgr; CFGAS_PDFFontMgr::ObservedPtr m_pProvider; - CFX_RetainPtr m_pStream; - CFX_RetainPtr m_pFileRead; + RetainPtr m_pStream; + RetainPtr m_pFileRead; std::unique_ptr m_pFontEncoding; std::map m_CharWidthMap; std::map m_BBoxMap; - std::vector> m_SubstFonts; - std::map> m_FontMapper; + std::vector> m_SubstFonts; + std::map> m_FontMapper; }; #endif // XFA_FGAS_FONT_CFGAS_GEFONT_H_ -- cgit v1.2.3