From 71a452f8ce12e31cc4e0d8c7878567b0c7fc63c2 Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 13 May 2016 17:51:27 -0700 Subject: Make CFX_ByteString(const CFX_ByteStringC&) explicit. Add missing helper function to CFX_ByteTextBuf to avoid the anti-pattern CFX_ByteString(sBuf.AsStringC()), using the name "Make" to indicate there's an allocation going on in this case. Change some method arguments to take pre-existing ByteStrings where possible. Review-Url: https://codereview.chromium.org/1977093002 --- core/fxge/ge/fx_ge_text.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/fxge/ge/fx_ge_text.cpp') diff --git a/core/fxge/ge/fx_ge_text.cpp b/core/fxge/ge/fx_ge_text.cpp index 3372b7f95d..b0f6a6e63a 100644 --- a/core/fxge/ge/fx_ge_text.cpp +++ b/core/fxge/ge/fx_ge_text.cpp @@ -1288,7 +1288,7 @@ void CFX_FaceCache::InitPlatform() {} CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap( CFX_Font* pFont, const CFX_Matrix* pMatrix, - CFX_ByteStringC& FaceGlyphsKey, + const CFX_ByteString& FaceGlyphsKey, uint32_t glyph_index, FX_BOOL bFontStyle, int dest_width, @@ -1359,7 +1359,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, dest_width, anti_alias, 3); } #endif - CFX_ByteStringC FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen); + CFX_ByteString FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen); #if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, bFontStyle, dest_width, anti_alias); @@ -1401,7 +1401,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, keygen.Generate(6, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000), (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias); - CFX_ByteStringC FaceGlyphsKey2(keygen.m_Key, keygen.m_KeyLen); + CFX_ByteString FaceGlyphsKey2(keygen.m_Key, keygen.m_KeyLen); text_flags |= FXTEXT_NO_NATIVETEXT; return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey2, glyph_index, bFontStyle, dest_width, anti_alias); -- cgit v1.2.3