diff options
Diffstat (limited to 'core/fxge')
-rw-r--r-- | core/fxge/cfx_fontmapper.cpp | 9 | ||||
-rw-r--r-- | core/fxge/cfx_fontmgr.cpp | 8 | ||||
-rw-r--r-- | core/fxge/cfx_fontmgr.h | 4 |
3 files changed, 10 insertions, 11 deletions
diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp index 0511b0a76a..bb80c27d51 100644 --- a/core/fxge/cfx_fontmapper.cpp +++ b/core/fxge/cfx_fontmapper.cpp @@ -763,7 +763,6 @@ FXFT_Face CFX_FontMapper::GetCachedTTCFace(void* hFont, const uint32_t tableTTCF, uint32_t ttc_size, uint32_t font_size) { - FXFT_Face face; uint8_t buffer[1024]; m_pFontInfo->GetFontData(hFont, tableTTCF, buffer, FX_ArraySize(buffer)); uint32_t* pBuffer = reinterpret_cast<uint32_t*>(buffer); @@ -771,8 +770,8 @@ FXFT_Face CFX_FontMapper::GetCachedTTCFace(void* hFont, for (int i = 0; i < 256; i++) checksum += pBuffer[i]; uint8_t* pFontData; - face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum, ttc_size - font_size, - pFontData); + FXFT_Face face = m_pFontMgr->GetCachedTTCFace( + ttc_size, checksum, ttc_size - font_size, &pFontData); if (!face) { pFontData = FX_Alloc(uint8_t, ttc_size); m_pFontInfo->GetFontData(hFont, tableTTCF, pFontData, ttc_size); @@ -787,9 +786,9 @@ FXFT_Face CFX_FontMapper::GetCachedFace(void* hFont, int weight, bool bItalic, uint32_t font_size) { - FXFT_Face face; uint8_t* pFontData; - face = m_pFontMgr->GetCachedFace(SubstName, weight, bItalic, pFontData); + FXFT_Face face = + m_pFontMgr->GetCachedFace(SubstName, weight, bItalic, &pFontData); if (!face) { pFontData = FX_Alloc(uint8_t, font_size); m_pFontInfo->GetFontData(hFont, 0, pFontData, font_size); diff --git a/core/fxge/cfx_fontmgr.cpp b/core/fxge/cfx_fontmgr.cpp index e12f341b3e..d9b03549e0 100644 --- a/core/fxge/cfx_fontmgr.cpp +++ b/core/fxge/cfx_fontmgr.cpp @@ -123,13 +123,13 @@ FXFT_Face CFX_FontMgr::FindSubstFont(const ByteString& face_name, FXFT_Face CFX_FontMgr::GetCachedFace(const ByteString& face_name, int weight, bool bItalic, - uint8_t*& pFontData) { + uint8_t** pFontData) { auto it = m_FaceMap.find(KeyNameFromFace(face_name, weight, bItalic)); if (it == m_FaceMap.end()) return nullptr; CTTFontDesc* pFontDesc = it->second.get(); - pFontData = pFontDesc->m_pFontData; + *pFontData = pFontDesc->m_pFontData; pFontDesc->m_RefCount++; return pFontDesc->m_SingleFace; } @@ -165,13 +165,13 @@ FXFT_Face CFX_FontMgr::AddCachedFace(const ByteString& face_name, FXFT_Face CFX_FontMgr::GetCachedTTCFace(int ttc_size, uint32_t checksum, int font_offset, - uint8_t*& pFontData) { + uint8_t** pFontData) { auto it = m_FaceMap.find(KeyNameFromSize(ttc_size, checksum)); if (it == m_FaceMap.end()) return nullptr; CTTFontDesc* pFontDesc = it->second.get(); - pFontData = pFontDesc->m_pFontData; + *pFontData = pFontDesc->m_pFontData; pFontDesc->m_RefCount++; int face_index = GetTTCIndex(pFontDesc->m_pFontData, ttc_size, font_offset); if (!pFontDesc->m_TTCFaces[face_index]) { diff --git a/core/fxge/cfx_fontmgr.h b/core/fxge/cfx_fontmgr.h index eddb1efd56..62ecd84716 100644 --- a/core/fxge/cfx_fontmgr.h +++ b/core/fxge/cfx_fontmgr.h @@ -27,7 +27,7 @@ class CFX_FontMgr { FXFT_Face GetCachedFace(const ByteString& face_name, int weight, bool bItalic, - uint8_t*& pFontData); + uint8_t** pFontData); FXFT_Face AddCachedFace(const ByteString& face_name, int weight, bool bItalic, @@ -37,7 +37,7 @@ class CFX_FontMgr { FXFT_Face GetCachedTTCFace(int ttc_size, uint32_t checksum, int font_offset, - uint8_t*& pFontData); + uint8_t** pFontData); FXFT_Face AddCachedTTCFace(int ttc_size, uint32_t checksum, uint8_t* pData, |