From e6ff2ebfaa19421c8d932f4d275548156ae2e13c Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 24 Aug 2018 21:55:46 +0000 Subject: Rename CFX_DIBSource to CFX_DIBBase. It is not a source from which you can get CFX_DIBs, but rather a base class from which all DIBs inherit. Do the same thing for the CPDF_DIBSource wrapper class. Mechanical change apart from adding a one-line comment in cfx_dibbase.h Change-Id: Id2bde87813ca301d9fafc55ce08d703dfc6a7184 Reviewed-on: https://pdfium-review.googlesource.com/41352 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- xfa/fxfa/cxfa_ffdoc.h | 6 +++--- xfa/fxfa/cxfa_imagerenderer.cpp | 31 ++++++++++++++----------------- xfa/fxfa/cxfa_imagerenderer.h | 6 +++--- xfa/fxfa/fxfa.h | 2 +- 4 files changed, 21 insertions(+), 24 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/cxfa_ffdoc.h b/xfa/fxfa/cxfa_ffdoc.h index 88becb4071..50888b8bde 100644 --- a/xfa/fxfa/cxfa_ffdoc.h +++ b/xfa/fxfa/cxfa_ffdoc.h @@ -29,12 +29,12 @@ class CXFA_FFDocView; struct FX_IMAGEDIB_AND_DPI { FX_IMAGEDIB_AND_DPI(); FX_IMAGEDIB_AND_DPI(const FX_IMAGEDIB_AND_DPI& that); - FX_IMAGEDIB_AND_DPI(const RetainPtr& pDib, + FX_IMAGEDIB_AND_DPI(const RetainPtr& pDib, int32_t xDpi, int32_t yDpi); ~FX_IMAGEDIB_AND_DPI(); - RetainPtr pDibSource; + RetainPtr pDibSource; int32_t iImageXDpi; int32_t iImageYDpi; }; @@ -44,7 +44,7 @@ inline FX_IMAGEDIB_AND_DPI::FX_IMAGEDIB_AND_DPI( const FX_IMAGEDIB_AND_DPI& that) = default; inline FX_IMAGEDIB_AND_DPI::FX_IMAGEDIB_AND_DPI( - const RetainPtr& pDib, + const RetainPtr& pDib, int32_t xDpi, int32_t yDpi) : pDibSource(pDib), iImageXDpi(xDpi), iImageYDpi(yDpi) {} diff --git a/xfa/fxfa/cxfa_imagerenderer.cpp b/xfa/fxfa/cxfa_imagerenderer.cpp index f90ea64a93..9f65eaa07c 100644 --- a/xfa/fxfa/cxfa_imagerenderer.cpp +++ b/xfa/fxfa/cxfa_imagerenderer.cpp @@ -7,23 +7,20 @@ #include "xfa/fxfa/cxfa_imagerenderer.h" #include "core/fxge/cfx_renderdevice.h" -#include "core/fxge/dib/cfx_dibsource.h" +#include "core/fxge/dib/cfx_dibbase.h" #include "core/fxge/dib/cfx_imagerenderer.h" #include "core/fxge/dib/cfx_imagetransformer.h" #include "third_party/base/ptr_util.h" -CXFA_ImageRenderer::CXFA_ImageRenderer( - CFX_RenderDevice* pDevice, - const RetainPtr& pDIBSource, - const CFX_Matrix* pImage2Device) - : m_pDevice(pDevice), - m_ImageMatrix(*pImage2Device), - m_pDIBSource(pDIBSource) {} +CXFA_ImageRenderer::CXFA_ImageRenderer(CFX_RenderDevice* pDevice, + const RetainPtr& pDIBBase, + const CFX_Matrix* pImage2Device) + : m_pDevice(pDevice), m_ImageMatrix(*pImage2Device), m_pDIBBase(pDIBBase) {} CXFA_ImageRenderer::~CXFA_ImageRenderer() {} bool CXFA_ImageRenderer::Start() { - if (m_pDevice->StartDIBitsWithBlend(m_pDIBSource, 255, 0, &m_ImageMatrix, + if (m_pDevice->StartDIBitsWithBlend(m_pDIBBase, 255, 0, &m_ImageMatrix, FXDIB_INTERPOL, &m_DeviceHandle, FXDIB_BLEND_NORMAL)) { if (m_DeviceHandle) { @@ -38,11 +35,11 @@ bool CXFA_ImageRenderer::Start() { int dest_height = image_rect.Height(); if ((fabs(m_ImageMatrix.b) >= 0.5f || m_ImageMatrix.a == 0) || (fabs(m_ImageMatrix.c) >= 0.5f || m_ImageMatrix.d == 0)) { - RetainPtr pDib = m_pDIBSource; - if (m_pDIBSource->HasAlpha() && + RetainPtr pDib = m_pDIBBase; + if (m_pDIBBase->HasAlpha() && !(m_pDevice->GetRenderCaps() & FXRC_ALPHA_IMAGE) && !(m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) { - m_pCloneConvert = m_pDIBSource->CloneConvert(FXDIB_Rgb); + m_pCloneConvert = m_pDIBBase->CloneConvert(FXDIB_Rgb); if (!m_pCloneConvert) return false; @@ -62,15 +59,15 @@ bool CXFA_ImageRenderer::Start() { int dest_left, dest_top; dest_left = dest_width > 0 ? image_rect.left : image_rect.right; dest_top = dest_height > 0 ? image_rect.top : image_rect.bottom; - if (m_pDIBSource->IsOpaqueImage()) { + if (m_pDIBBase->IsOpaqueImage()) { if (m_pDevice->StretchDIBitsWithFlagsAndBlend( - m_pDIBSource, dest_left, dest_top, dest_width, dest_height, + m_pDIBBase, 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, + if (m_pDIBBase->IsAlphaMask()) { + if (m_pDevice->StretchBitMaskWithFlags(m_pDIBBase, dest_left, dest_top, dest_width, dest_height, 0, FXDIB_INTERPOL)) { return false; @@ -83,7 +80,7 @@ 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( + RetainPtr pStretched = m_pDIBBase->StretchTo( dest_width, dest_height, FXDIB_INTERPOL, &dest_clip); if (pStretched) CompositeDIBitmap(pStretched, dest_rect.left, dest_rect.top); diff --git a/xfa/fxfa/cxfa_imagerenderer.h b/xfa/fxfa/cxfa_imagerenderer.h index 236c3ccc5a..0b727c9ab4 100644 --- a/xfa/fxfa/cxfa_imagerenderer.h +++ b/xfa/fxfa/cxfa_imagerenderer.h @@ -15,7 +15,7 @@ #include "core/fxge/fx_dib.h" class CFX_RenderDevice; -class CFX_DIBSource; +class CFX_DIBBase; class CFX_DIBitmap; class CFX_ImageTransformer; class CFX_ImageRenderer; @@ -23,7 +23,7 @@ class CFX_ImageRenderer; class CXFA_ImageRenderer { public: CXFA_ImageRenderer(CFX_RenderDevice* pDevice, - const RetainPtr& pDIBSource, + const RetainPtr& pDIBBase, const CFX_Matrix* pImage2Device); ~CXFA_ImageRenderer(); @@ -38,7 +38,7 @@ class CXFA_ImageRenderer { UnownedPtr m_pDevice; int m_Status = 0; CFX_Matrix m_ImageMatrix; - RetainPtr m_pDIBSource; + RetainPtr m_pDIBBase; RetainPtr m_pCloneConvert; std::unique_ptr m_pTransformer; std::unique_ptr m_DeviceHandle; diff --git a/xfa/fxfa/fxfa.h b/xfa/fxfa/fxfa.h index 254d99f924..9030e87c8e 100644 --- a/xfa/fxfa/fxfa.h +++ b/xfa/fxfa/fxfa.h @@ -12,7 +12,7 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/retain_ptr.h" -#include "core/fxge/dib/cfx_dibsource.h" +#include "core/fxge/dib/cfx_dibbase.h" #include "core/fxge/fx_dib.h" #include "xfa/fxfa/fxfa_basic.h" -- cgit v1.2.3