From 8bd669bb535895814c5eb79716ed67f67e1d76b5 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 17 Jan 2018 15:14:47 +0000 Subject: Remove bitmap ARGB from CFX_ImageRenderer This CL removes the fill ARGB value from CFX_ImageRenderer which is always set to 0. Change-Id: I445abd6268c14f05184988177b2fa6b80f50d41d Reviewed-on: https://pdfium-review.googlesource.com/23052 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/cxfa_ffwidget.cpp | 2 +- xfa/fxfa/cxfa_imagerenderer.cpp | 27 +++++++++++---------------- xfa/fxfa/cxfa_imagerenderer.h | 3 --- 3 files changed, 12 insertions(+), 20 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index 34965236f9..f6806f6841 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -1091,7 +1091,7 @@ void XFA_DrawImage(CXFA_Graphics* pGS, CFX_Matrix(rtFit.width, 0, 0, rtFit.height, rtFit.left, rtFit.top)); mtImage.Concat(matrix); - CXFA_ImageRenderer imageRender(pRenderDevice, pDIBitmap, 0, &mtImage, + CXFA_ImageRenderer imageRender(pRenderDevice, pDIBitmap, &mtImage, FXDIB_INTERPOL); if (!imageRender.Start()) { return; diff --git a/xfa/fxfa/cxfa_imagerenderer.cpp b/xfa/fxfa/cxfa_imagerenderer.cpp index a56f4d94a6..b1a5ee7200 100644 --- a/xfa/fxfa/cxfa_imagerenderer.cpp +++ b/xfa/fxfa/cxfa_imagerenderer.cpp @@ -16,21 +16,18 @@ CXFA_ImageRenderer::CXFA_ImageRenderer( CFX_RenderDevice* pDevice, const RetainPtr& pDIBSource, - FX_ARGB bitmap_argb, const CFX_Matrix* pImage2Device, uint32_t flags) : m_pDevice(pDevice), m_ImageMatrix(*pImage2Device), m_pDIBSource(pDIBSource), - m_FillArgb(bitmap_argb), m_Flags(flags) {} CXFA_ImageRenderer::~CXFA_ImageRenderer() {} bool CXFA_ImageRenderer::Start() { - if (m_pDevice->StartDIBitsWithBlend(m_pDIBSource, 255, m_FillArgb, - &m_ImageMatrix, m_Flags, &m_DeviceHandle, - m_BlendType)) { + if (m_pDevice->StartDIBitsWithBlend(m_pDIBSource, 255, 0, &m_ImageMatrix, + m_Flags, &m_DeviceHandle, m_BlendType)) { if (m_DeviceHandle) { m_Status = 3; return true; @@ -81,7 +78,7 @@ bool CXFA_ImageRenderer::Start() { } if (m_pDIBSource->IsAlphaMask()) { if (m_pDevice->StretchBitMaskWithFlags(m_pDIBSource, dest_left, dest_top, - dest_width, dest_height, m_FillArgb, + dest_width, dest_height, 0, m_Flags)) { return false; } @@ -99,8 +96,8 @@ bool CXFA_ImageRenderer::Start() { RetainPtr pStretched = m_pDIBSource->StretchTo(dest_width, dest_height, m_Flags, &dest_clip); if (pStretched) { - CompositeDIBitmap(pStretched, dest_rect.left, dest_rect.top, m_FillArgb, - m_BlendType, false); + CompositeDIBitmap(pStretched, dest_rect.left, dest_rect.top, m_BlendType, + false); } return false; } @@ -115,9 +112,8 @@ bool CXFA_ImageRenderer::Continue() { return false; if (pBitmap->IsAlphaMask()) { - m_Result = - m_pDevice->SetBitMask(pBitmap, m_pTransformer->result().left, - m_pTransformer->result().top, m_FillArgb); + m_Result = m_pDevice->SetBitMask(pBitmap, m_pTransformer->result().left, + m_pTransformer->result().top, 0); } else { m_Result = m_pDevice->SetDIBitsWithBlend( pBitmap, m_pTransformer->result().left, m_pTransformer->result().top, @@ -135,7 +131,6 @@ void CXFA_ImageRenderer::CompositeDIBitmap( const RetainPtr& pDIBitmap, int left, int top, - FX_ARGB mask_argb, int blend_mode, int iTransparency) { if (!pDIBitmap) { @@ -148,7 +143,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap( if (m_pDevice->SetDIBits(pDIBitmap, left, top)) return; } else { - uint32_t fill_argb = (mask_argb); + uint32_t fill_argb = 0; if (m_pDevice->SetBitMask(pDIBitmap, left, top, fill_argb)) return; } @@ -181,7 +176,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap( pDIBitmap, left, top, blend_mode); else pClone->CompositeMask(0, 0, pClone->GetWidth(), pClone->GetHeight(), - pDIBitmap, mask_argb, left, top, blend_mode); + pDIBitmap, 0, left, top, blend_mode); } else { pClone = pDIBitmap; } @@ -204,8 +199,8 @@ void CXFA_ImageRenderer::CompositeDIBitmap( if (!pCloneConvert) return; - CXFA_ImageRenderer imageRender(m_pDevice, pCloneConvert, m_FillArgb, - &m_ImageMatrix, m_Flags); + CXFA_ImageRenderer imageRender(m_pDevice, pCloneConvert, &m_ImageMatrix, + m_Flags); if (!imageRender.Start()) { return; } diff --git a/xfa/fxfa/cxfa_imagerenderer.h b/xfa/fxfa/cxfa_imagerenderer.h index 45ab32721d..ecf4f36dc3 100644 --- a/xfa/fxfa/cxfa_imagerenderer.h +++ b/xfa/fxfa/cxfa_imagerenderer.h @@ -23,7 +23,6 @@ class CXFA_ImageRenderer { public: CXFA_ImageRenderer(CFX_RenderDevice* pDevice, const RetainPtr& pDIBSource, - FX_ARGB bitmap_argb, const CFX_Matrix* pImage2Device, uint32_t flags); ~CXFA_ImageRenderer(); @@ -35,7 +34,6 @@ class CXFA_ImageRenderer { void CompositeDIBitmap(const RetainPtr& pDIBitmap, int left, int top, - FX_ARGB mask_argb, int blend_mode, int iTransparency); @@ -44,7 +42,6 @@ class CXFA_ImageRenderer { CFX_Matrix m_ImageMatrix; RetainPtr m_pDIBSource; RetainPtr m_pCloneConvert; - FX_ARGB m_FillArgb; uint32_t m_Flags; std::unique_ptr m_pTransformer; std::unique_ptr m_DeviceHandle; -- cgit v1.2.3