summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp
diff options
context:
space:
mode:
authorart-snake <art-snake@yandex-team.ru>2016-09-20 07:46:25 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-20 07:46:26 -0700
commit9972ff99285cea12a20026136e98c1e635a15010 (patch)
tree7ddd9c0a49329baccd0e570fe064527b794c1fde /xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp
parent717d1330bafb846e4cd25bfb4952bfdedce0db91 (diff)
downloadpdfium-9972ff99285cea12a20026136e98c1e635a15010.tar.xz
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
Diffstat (limited to 'xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp')
-rw-r--r--xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp
index e2bbfd5726..632738779a 100644
--- a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp
@@ -231,8 +231,7 @@ void CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents,
ge.Create(strWidth, iTextHeight, FXDIB_Argb, nullptr);
FX_RECT rect(0, 0, strWidth, iTextHeight);
ge.FillRect(&rect, m_backgroundColor);
- ge.DrawNormalText(iLen, pCharPos + 1, m_pFont,
- CFX_GEModule::Get()->GetFontCache(), (FX_FLOAT)iFontSize,
+ ge.DrawNormalText(iLen, pCharPos + 1, m_pFont, (FX_FLOAT)iFontSize,
&affine_matrix, m_fontColor, FXTEXT_CLEARTYPE);
geBitmap.SetDIBits(ge.GetBitmap(), leftPosition, m_Height - iTextHeight);
} else {
@@ -242,9 +241,8 @@ void CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents,
if (matrix) {
affine_matrix1.Concat(*matrix);
}
- device->DrawNormalText(
- iLen, pCharPos + 1, m_pFont, CFX_GEModule::Get()->GetFontCache(),
- (FX_FLOAT)iFontSize, &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE);
+ device->DrawNormalText(iLen, pCharPos + 1, m_pFont, (FX_FLOAT)iFontSize,
+ &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE);
}
tempStr = str.Mid(7, 6);
iLen = tempStr.GetLength();
@@ -253,8 +251,7 @@ void CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents,
if (pOutBitmap) {
FX_RECT rect1(0, 0, strWidth, iTextHeight);
ge.FillRect(&rect1, m_backgroundColor);
- ge.DrawNormalText(iLen, pCharPos + 7, m_pFont,
- CFX_GEModule::Get()->GetFontCache(), (FX_FLOAT)iFontSize,
+ ge.DrawNormalText(iLen, pCharPos + 7, m_pFont, (FX_FLOAT)iFontSize,
&affine_matrix, m_fontColor, FXTEXT_CLEARTYPE);
geBitmap.SetDIBits(ge.GetBitmap(), leftPosition + 47 * multiple,
m_Height - iTextHeight);
@@ -266,9 +263,8 @@ void CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents,
if (matrix) {
affine_matrix1.Concat(*matrix);
}
- device->DrawNormalText(
- iLen, pCharPos + 7, m_pFont, CFX_GEModule::Get()->GetFontCache(),
- (FX_FLOAT)iFontSize, &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE);
+ device->DrawNormalText(iLen, pCharPos + 7, m_pFont, (FX_FLOAT)iFontSize,
+ &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE);
}
tempStr = str.Mid(0, 1);
iLen = tempStr.GetLength();
@@ -282,8 +278,7 @@ void CBC_OnedEAN13Writer::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(), 0, m_Height - iTextHeight);
} else {
@@ -292,9 +287,8 @@ void CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents,
if (matrix) {
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);
}
FX_Free(pCharPos);
}