From 62d4bb21760706a5d466869db05b504548e7108a Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 16 Jan 2018 20:44:56 +0000 Subject: Remove CXFA_Graphics::StretchImage() and related code. It is never used. Change-Id: I46c8202cb9e449317fdc1889ff9a610d5ea15d92 Reviewed-on: https://pdfium-review.googlesource.com/22910 Reviewed-by: Ryan Harrison Commit-Queue: Lei Zhang --- xfa/fwl/cfwl_themebackground.h | 2 -- xfa/fwl/theme/cfwl_listboxtp.cpp | 5 ----- xfa/fxgraphics/cxfa_graphics.cpp | 35 +---------------------------------- xfa/fxgraphics/cxfa_graphics.h | 7 ------- 4 files changed, 1 insertion(+), 48 deletions(-) (limited to 'xfa') diff --git a/xfa/fwl/cfwl_themebackground.h b/xfa/fwl/cfwl_themebackground.h index 81fa0a2212..33a0e857f2 100644 --- a/xfa/fwl/cfwl_themebackground.h +++ b/xfa/fwl/cfwl_themebackground.h @@ -10,7 +10,6 @@ #include "core/fxge/fx_dib.h" #include "xfa/fwl/cfwl_themepart.h" -class CFX_DIBitmpa; class CXFA_Graphics; class CXFA_GEPath; @@ -21,7 +20,6 @@ class CFWL_ThemeBackground : public CFWL_ThemePart { CXFA_Graphics* m_pGraphics; CXFA_GEPath* m_pPath; - RetainPtr m_pImage; }; inline CFWL_ThemeBackground::CFWL_ThemeBackground() diff --git a/xfa/fwl/theme/cfwl_listboxtp.cpp b/xfa/fwl/theme/cfwl_listboxtp.cpp index c977b21120..6b8aa768a5 100644 --- a/xfa/fwl/theme/cfwl_listboxtp.cpp +++ b/xfa/fwl/theme/cfwl_listboxtp.cpp @@ -39,11 +39,6 @@ void CFWL_ListBoxTP::DrawBackground(CFWL_ThemeBackground* pParams) { &pParams->m_rtPart, pParams->m_pData, &pParams->m_matrix); break; } - case CFWL_Part::Icon: { - pParams->m_pGraphics->StretchImage(pParams->m_pImage, pParams->m_rtPart, - pParams->m_matrix); - break; - } case CFWL_Part::Check: { uint32_t color = 0xFF000000; if (pParams->m_dwStates == CFWL_PartState_Checked) { diff --git a/xfa/fxgraphics/cxfa_graphics.cpp b/xfa/fxgraphics/cxfa_graphics.cpp index 66a109ddaa..47517309b7 100644 --- a/xfa/fxgraphics/cxfa_graphics.cpp +++ b/xfa/fxgraphics/cxfa_graphics.cpp @@ -11,6 +11,7 @@ #include "core/fxge/cfx_defaultrenderdevice.h" #include "core/fxge/cfx_renderdevice.h" #include "core/fxge/cfx_unicodeencoding.h" +#include "core/fxge/dib/cfx_dibitmap.h" #include "third_party/base/ptr_util.h" #include "xfa/fxgraphics/cxfa_gecolor.h" #include "xfa/fxgraphics/cxfa_gepath.h" @@ -194,15 +195,6 @@ void CXFA_Graphics::FillPath(CXFA_GEPath* path, RenderDeviceFillPath(path, fillMode, matrix); } -void CXFA_Graphics::StretchImage(const RetainPtr& source, - const CFX_RectF& rect, - const CFX_Matrix& matrix) { - if (!source) - return; - if (m_type == FX_CONTEXT_Device && m_renderDevice) - RenderDeviceStretchImage(source, rect, matrix); -} - void CXFA_Graphics::ConcatMatrix(const CFX_Matrix* matrix) { if (!matrix) return; @@ -304,31 +296,6 @@ void CXFA_Graphics::RenderDeviceFillPath(const CXFA_GEPath* path, } } -void CXFA_Graphics::RenderDeviceStretchImage( - const RetainPtr& source, - const CFX_RectF& rect, - const CFX_Matrix& matrix) { - CFX_Matrix m1(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, - m_info.CTM.e, m_info.CTM.f); - m1.Concat(matrix); - - RetainPtr bmp1 = - source->StretchTo(static_cast(rect.Width()), - static_cast(rect.Height()), 0, nullptr); - CFX_Matrix m2(rect.Width(), 0.0, 0.0, rect.Height(), rect.left, rect.top); - m2.Concat(m1); - - int32_t left; - int32_t top; - RetainPtr bmp2 = bmp1->FlipImage(false, true); - RetainPtr bmp3 = bmp2->TransformTo(&m2, &left, &top); - CFX_RectF r = GetClipRect(); - RetainPtr bitmap = m_renderDevice->GetBitmap(); - bitmap->CompositeBitmap(FXSYS_round(r.left), FXSYS_round(r.top), - FXSYS_round(r.Width()), FXSYS_round(r.Height()), bmp3, - FXSYS_round(r.left - left), FXSYS_round(r.top - top)); -} - void CXFA_Graphics::FillPathWithPattern(const CXFA_GEPath* path, FX_FillMode fillMode, const CFX_Matrix& matrix) { diff --git a/xfa/fxgraphics/cxfa_graphics.h b/xfa/fxgraphics/cxfa_graphics.h index 16cd123fc7..c8843bc87d 100644 --- a/xfa/fxgraphics/cxfa_graphics.h +++ b/xfa/fxgraphics/cxfa_graphics.h @@ -15,7 +15,6 @@ #include "core/fxge/cfx_graphstatedata.h" #include "core/fxge/cfx_renderdevice.h" #include "core/fxge/fx_dib.h" -#include "core/fxge/fx_font.h" #include "xfa/fxgraphics/cxfa_gecolor.h" class CXFA_GEPath; @@ -65,9 +64,6 @@ class CXFA_Graphics { void FillPath(CXFA_GEPath* path, FX_FillMode fillMode, const CFX_Matrix* matrix); - void StretchImage(const RetainPtr& source, - const CFX_RectF& rect, - const CFX_Matrix& matrix); void ConcatMatrix(const CFX_Matrix* matrix); protected: @@ -92,9 +88,6 @@ class CXFA_Graphics { void RenderDeviceFillPath(const CXFA_GEPath* path, FX_FillMode fillMode, const CFX_Matrix* matrix); - void RenderDeviceStretchImage(const RetainPtr& source, - const CFX_RectF& rect, - const CFX_Matrix& matrix); void FillPathWithPattern(const CXFA_GEPath* path, FX_FillMode fillMode, -- cgit v1.2.3