From a49dc5b6fc0cb08991c111c747b35d9a4ec45b3f Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 17 Jan 2018 15:28:26 +0000 Subject: Remove flags param from CXFA_ImageRenderer The flags are always set to the same value. This CL removes them and inlines the value as needed. Change-Id: I379a053aee31829229d83291d666904564b99aea Reviewed-on: https://pdfium-review.googlesource.com/23057 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/cxfa_ffwidget.cpp | 3 +-- xfa/fxfa/cxfa_imagerenderer.cpp | 23 ++++++++++------------- xfa/fxfa/cxfa_imagerenderer.h | 4 +--- 3 files changed, 12 insertions(+), 18 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index f6806f6841..b24b6dacab 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -1091,8 +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, &mtImage, - FXDIB_INTERPOL); + CXFA_ImageRenderer imageRender(pRenderDevice, pDIBitmap, &mtImage); if (!imageRender.Start()) { return; } diff --git a/xfa/fxfa/cxfa_imagerenderer.cpp b/xfa/fxfa/cxfa_imagerenderer.cpp index dfa45f07d7..f6cb5e9317 100644 --- a/xfa/fxfa/cxfa_imagerenderer.cpp +++ b/xfa/fxfa/cxfa_imagerenderer.cpp @@ -15,18 +15,16 @@ CXFA_ImageRenderer::CXFA_ImageRenderer( CFX_RenderDevice* pDevice, const RetainPtr& pDIBSource, - const CFX_Matrix* pImage2Device, - uint32_t flags) + const CFX_Matrix* pImage2Device) : m_pDevice(pDevice), m_ImageMatrix(*pImage2Device), - m_pDIBSource(pDIBSource), - m_Flags(flags) {} + m_pDIBSource(pDIBSource) {} CXFA_ImageRenderer::~CXFA_ImageRenderer() {} bool CXFA_ImageRenderer::Start() { if (m_pDevice->StartDIBitsWithBlend(m_pDIBSource, 255, 0, &m_ImageMatrix, - m_Flags, &m_DeviceHandle, + FXDIB_INTERPOL, &m_DeviceHandle, FXDIB_BLEND_NORMAL)) { if (m_DeviceHandle) { m_Status = 3; @@ -54,7 +52,7 @@ bool CXFA_ImageRenderer::Start() { clip_box.Intersect(image_rect); m_Status = 2; m_pTransformer = pdfium::MakeUnique( - pDib, &m_ImageMatrix, m_Flags, &clip_box); + pDib, &m_ImageMatrix, FXDIB_INTERPOL, &clip_box); return true; } if (m_ImageMatrix.a < 0) @@ -66,15 +64,15 @@ bool CXFA_ImageRenderer::Start() { dest_top = dest_height > 0 ? image_rect.top : image_rect.bottom; if (m_pDIBSource->IsOpaqueImage()) { if (m_pDevice->StretchDIBitsWithFlagsAndBlend( - m_pDIBSource, dest_left, dest_top, dest_width, dest_height, m_Flags, - FXDIB_BLEND_NORMAL)) { + m_pDIBSource, dest_left, dest_top, dest_width, dest_height, + FXDIB_INTERPOL, FXDIB_BLEND_NORMAL)) { return false; } } if (m_pDIBSource->IsAlphaMask()) { if (m_pDevice->StretchBitMaskWithFlags(m_pDIBSource, dest_left, dest_top, dest_width, dest_height, 0, - m_Flags)) { + FXDIB_INTERPOL)) { return false; } } @@ -85,8 +83,8 @@ bool CXFA_ImageRenderer::Start() { FX_RECT dest_clip( dest_rect.left - image_rect.left, dest_rect.top - image_rect.top, dest_rect.right - image_rect.left, dest_rect.bottom - image_rect.top); - RetainPtr pStretched = - m_pDIBSource->StretchTo(dest_width, dest_height, m_Flags, &dest_clip); + RetainPtr pStretched = m_pDIBSource->StretchTo( + dest_width, dest_height, FXDIB_INTERPOL, &dest_clip); if (pStretched) CompositeDIBitmap(pStretched, dest_rect.left, dest_rect.top); @@ -151,8 +149,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap( if (!pCloneConvert) return; - CXFA_ImageRenderer imageRender(m_pDevice, pCloneConvert, &m_ImageMatrix, - m_Flags); + CXFA_ImageRenderer imageRender(m_pDevice, pCloneConvert, &m_ImageMatrix); if (!imageRender.Start()) return; diff --git a/xfa/fxfa/cxfa_imagerenderer.h b/xfa/fxfa/cxfa_imagerenderer.h index 7e013d3243..8ed9ab0c75 100644 --- a/xfa/fxfa/cxfa_imagerenderer.h +++ b/xfa/fxfa/cxfa_imagerenderer.h @@ -23,8 +23,7 @@ class CXFA_ImageRenderer { public: CXFA_ImageRenderer(CFX_RenderDevice* pDevice, const RetainPtr& pDIBSource, - const CFX_Matrix* pImage2Device, - uint32_t flags); + const CFX_Matrix* pImage2Device); ~CXFA_ImageRenderer(); bool Start(); @@ -40,7 +39,6 @@ class CXFA_ImageRenderer { CFX_Matrix m_ImageMatrix; RetainPtr m_pDIBSource; RetainPtr m_pCloneConvert; - uint32_t m_Flags; std::unique_ptr m_pTransformer; std::unique_ptr m_DeviceHandle; }; -- cgit v1.2.3