From 9972ff99285cea12a20026136e98c1e635a15010 Mon Sep 17 00:00:00 2001 From: art-snake Date: Tue, 20 Sep 2016 07:46:25 -0700 Subject: Refactor CFX_FontCache to have only one in GE Module. After this CL: only one global CFX_FontCache used. Any cached items from it, are released, when they are not being used. This is restore part of reverted CL: Original CL: https://codereview.chromium.org/2158023002 Revert reason: BUG=647612 Fix bug CL: https://codereview.chromium.org/2350193003 Review-Url: https://codereview.chromium.org/2350243002 --- xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp') diff --git a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp index 0a7f3a8a50..fb95f264a0 100644 --- a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp +++ b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp @@ -222,8 +222,7 @@ void CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents, delete ge.GetBitmap(); ge.Create(strWidth, iTextHeight, FXDIB_Argb, nullptr); ge.GetBitmap()->Clear(m_backgroundColor); - ge.DrawNormalText(iLen, pCharPos, m_pFont, - CFX_GEModule::Get()->GetFontCache(), (FX_FLOAT)iFontSize, + ge.DrawNormalText(iLen, pCharPos, m_pFont, (FX_FLOAT)iFontSize, &affine_matrix, m_fontColor, FXTEXT_CLEARTYPE); geBitmap.SetDIBits(ge.GetBitmap(), leftPosition, m_Height - iTextHeight); } else { @@ -231,9 +230,8 @@ void CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents, (FX_FLOAT)leftPosition * m_outputHScale, (FX_FLOAT)(m_Height - iTextHeight + iFontSize)); affine_matrix1.Concat(*matrix); - device->DrawNormalText( - iLen, pCharPos, m_pFont, CFX_GEModule::Get()->GetFontCache(), - (FX_FLOAT)iFontSize, &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); + device->DrawNormalText(iLen, pCharPos, m_pFont, (FX_FLOAT)iFontSize, + &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } tempStr = str.Mid(4, 4); iLen = tempStr.GetLength(); @@ -243,8 +241,7 @@ void CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents, delete ge.GetBitmap(); ge.Create(strWidth, iTextHeight, FXDIB_Argb, nullptr); ge.GetBitmap()->Clear(m_backgroundColor); - ge.DrawNormalText(iLen, pCharPos + 4, m_pFont, - CFX_GEModule::Get()->GetFontCache(), (FX_FLOAT)iFontSize, + ge.DrawNormalText(iLen, pCharPos + 4, m_pFont, (FX_FLOAT)iFontSize, &affine_matrix, m_fontColor, FXTEXT_CLEARTYPE); geBitmap.SetDIBits(ge.GetBitmap(), leftPosition + 33 * multiple, m_Height - iTextHeight); @@ -256,9 +253,8 @@ void CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents, if (matrix) { affine_matrix1.Concat(*matrix); } - device->DrawNormalText( - iLen, pCharPos + 4, m_pFont, CFX_GEModule::Get()->GetFontCache(), - (FX_FLOAT)iFontSize, &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); + device->DrawNormalText(iLen, pCharPos + 4, m_pFont, (FX_FLOAT)iFontSize, + &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } FX_Free(pCharPos); } -- cgit v1.2.3