From f0799fe84df4d86f25d342b03525f3016d674f86 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 28 Mar 2017 09:31:32 -0700 Subject: Revert "Revert "Refcount all CFX_DIBSources (and subclasses) all the time."" This reverts commit 31b08d4cdaa17d7a03f35e087096a77036af98ec. Re-landing the patch after fixing skia build issue. Change-Id: Ie7039890088b803a6ec5ce365d70f57277459b48 Reviewed-on: https://pdfium-review.googlesource.com/3245 Commit-Queue: Tom Sepez Commit-Queue: dsinclair Reviewed-by: dsinclair --- xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp') diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp index cefae97d8d..540e852d5d 100644 --- a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp +++ b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp @@ -117,13 +117,14 @@ uint8_t* CBC_OnedUPCAWriter::Encode(const CFX_ByteString& contents, return nullptr; } -void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents, - CFX_DIBitmap* pOutBitmap, - CFX_RenderDevice* device, - const CFX_Matrix* matrix, - int32_t barWidth, - int32_t multiple, - int32_t& e) { +void CBC_OnedUPCAWriter::ShowChars( + const CFX_WideStringC& contents, + const CFX_RetainPtr& pOutBitmap, + CFX_RenderDevice* device, + const CFX_Matrix* matrix, + int32_t barWidth, + int32_t multiple, + int32_t& e) { if (!device && !pOutBitmap) { e = BCExceptionIllegalArgument; return; @@ -235,7 +236,6 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents, CalcTextInfo(tempStr, pCharPos, m_pFont, strWidth, iFontSize, blank); if (pOutBitmap) { - delete ge.GetBitmap(); ge.Create((int)strWidth, iTextHeight, FXDIB_Argb, nullptr); ge.GetBitmap()->Clear(m_backgroundColor); ge.DrawNormalText(iLen, pCharPos, m_pFont, static_cast(iFontSize), @@ -255,7 +255,6 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents, iLen = tempStr.GetLength(); CalcTextInfo(tempStr, pCharPos + 11, m_pFont, strWidth, iFontSize, blank); if (pOutBitmap) { - delete ge.GetBitmap(); ge.Create((int)strWidth, iTextHeight, FXDIB_Argb, nullptr); ge.GetBitmap()->Clear(m_backgroundColor); ge.DrawNormalText(iLen, pCharPos + 11, m_pFont, -- cgit v1.2.3