| Index: xfa/fxfa/app/xfa_ffwidget.cpp
|
| diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp
|
| index f4b6a8aeb9c9295a036857b9f605ae7f472bd0b2..0d60c7751a449fca6505c109301ab573d1f2c78f 100644
|
| --- a/xfa/fxfa/app/xfa_ffwidget.cpp
|
| +++ b/xfa/fxfa/app/xfa_ffwidget.cpp
|
| @@ -563,11 +563,20 @@ class CXFA_ImageRenderer {
|
| FX_BOOL Continue(IFX_Pause* pPause);
|
|
|
| protected:
|
| + FX_BOOL StartDIBSource();
|
| + void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
|
| + int left,
|
| + int top,
|
| + FX_ARGB mask_argb,
|
| + int bitmap_alpha,
|
| + int blend_mode,
|
| + int Transparency);
|
| +
|
| CFX_RenderDevice* m_pDevice;
|
| int m_Status;
|
| CFX_Matrix m_ImageMatrix;
|
| CFX_DIBSource* m_pDIBSource;
|
| - CFX_DIBitmap* m_pCloneConvert;
|
| + std::unique_ptr<CFX_DIBitmap> m_pCloneConvert;
|
| int m_BitmapAlpha;
|
| FX_ARGB m_FillArgb;
|
| uint32_t m_Flags;
|
| @@ -576,31 +585,21 @@ class CXFA_ImageRenderer {
|
| int32_t m_BlendType;
|
| FX_BOOL m_Result;
|
| FX_BOOL m_bPrint;
|
| - FX_BOOL StartDIBSource();
|
| - void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
|
| - int left,
|
| - int top,
|
| - FX_ARGB mask_argb,
|
| - int bitmap_alpha,
|
| - int blend_mode,
|
| - int Transparency);
|
| };
|
| -CXFA_ImageRenderer::CXFA_ImageRenderer() {
|
| - m_pDevice = nullptr;
|
| - m_Status = 0;
|
| - m_pDIBSource = nullptr;
|
| - m_pCloneConvert = nullptr;
|
| - m_BitmapAlpha = 255;
|
| - m_FillArgb = 0;
|
| - m_Flags = 0;
|
| - m_DeviceHandle = nullptr;
|
| - m_BlendType = FXDIB_BLEND_NORMAL;
|
| - m_Result = TRUE;
|
| - m_bPrint = FALSE;
|
| -}
|
| +
|
| +CXFA_ImageRenderer::CXFA_ImageRenderer()
|
| + : m_pDevice(nullptr),
|
| + m_Status(0),
|
| + m_pDIBSource(nullptr),
|
| + m_BitmapAlpha(255),
|
| + m_FillArgb(0),
|
| + m_Flags(0),
|
| + m_DeviceHandle(nullptr),
|
| + m_BlendType(FXDIB_BLEND_NORMAL),
|
| + m_Result(TRUE),
|
| + m_bPrint(FALSE) {}
|
|
|
| CXFA_ImageRenderer::~CXFA_ImageRenderer() {
|
| - delete m_pCloneConvert;
|
| if (m_DeviceHandle)
|
| m_pDevice->CancelDIBits(m_DeviceHandle);
|
| }
|
| @@ -646,12 +645,12 @@ FX_BOOL CXFA_ImageRenderer::StartDIBSource() {
|
| if (m_pDIBSource->HasAlpha() &&
|
| !(m_pDevice->GetRenderCaps() & FXRC_ALPHA_IMAGE) &&
|
| !(m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) {
|
| - m_pCloneConvert = m_pDIBSource->CloneConvert(FXDIB_Rgb);
|
| + m_pCloneConvert.reset(m_pDIBSource->CloneConvert(FXDIB_Rgb));
|
| if (!m_pCloneConvert) {
|
| m_Result = FALSE;
|
| return FALSE;
|
| }
|
| - pDib = m_pCloneConvert;
|
| + pDib = m_pCloneConvert.get();
|
| }
|
| FX_RECT clip_box = m_pDevice->GetClipBox();
|
| clip_box.Intersect(image_rect);
|
|
|