From 5ada7bcf1f200eaa8d78ea2c74233b6b54f6d5f5 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 25 Oct 2018 19:28:10 +0000 Subject: Change StartDIBits() to take a matrix by reference. In RenderDeviceDriverIface and related classes, and for related methods in the call stack. Change-Id: I420fafe70084eb3941dffc6f9f51ecbed79581de Reviewed-on: https://pdfium-review.googlesource.com/c/44552 Commit-Queue: Lei Zhang Reviewed-by: Tom Sepez --- core/fxge/win32/fx_win32_print.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'core/fxge/win32/fx_win32_print.cpp') diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp index 1f9b9510f7..b92a46d08f 100644 --- a/core/fxge/win32/fx_win32_print.cpp +++ b/core/fxge/win32/fx_win32_print.cpp @@ -161,7 +161,7 @@ bool CGdiPrinterDriver::StretchDIBits(const RetainPtr& pSource, bool CGdiPrinterDriver::StartDIBits(const RetainPtr& pSource, int bitmap_alpha, uint32_t color, - const CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t render_flags, std::unique_ptr* handle, BlendMode blend_type) { @@ -169,12 +169,12 @@ bool CGdiPrinterDriver::StartDIBits(const RetainPtr& pSource, (pSource->IsAlphaMask() && (pSource->GetBPP() != 1))) { return false; } - CFX_FloatRect unit_rect = pMatrix->GetUnitRect(); + CFX_FloatRect unit_rect = matrix.GetUnitRect(); FX_RECT full_rect = unit_rect.GetOuterRect(); - if (fabs(pMatrix->b) < 0.5f && pMatrix->a != 0 && fabs(pMatrix->c) < 0.5f && - pMatrix->d != 0) { - bool bFlipX = pMatrix->a < 0; - bool bFlipY = pMatrix->d > 0; + if (fabs(matrix.b) < 0.5f && matrix.a != 0 && fabs(matrix.c) < 0.5f && + matrix.d != 0) { + bool bFlipX = matrix.a < 0; + bool bFlipY = matrix.d > 0; return StretchDIBits(pSource, color, bFlipX ? full_rect.right : full_rect.left, bFlipY ? full_rect.bottom : full_rect.top, @@ -182,11 +182,11 @@ bool CGdiPrinterDriver::StartDIBits(const RetainPtr& pSource, bFlipY ? -full_rect.Height() : full_rect.Height(), nullptr, 0, blend_type); } - if (fabs(pMatrix->a) >= 0.5f || fabs(pMatrix->d) >= 0.5f) + if (fabs(matrix.a) >= 0.5f || fabs(matrix.d) >= 0.5f) return false; RetainPtr pTransformed = - pSource->SwapXY(pMatrix->c > 0, pMatrix->b < 0); + pSource->SwapXY(matrix.c > 0, matrix.b < 0); if (!pTransformed) return false; @@ -482,7 +482,7 @@ bool CPSPrinterDriver::StretchDIBits(const RetainPtr& pBitmap, bool CPSPrinterDriver::StartDIBits(const RetainPtr& pBitmap, int bitmap_alpha, uint32_t color, - const CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t render_flags, std::unique_ptr* handle, BlendMode blend_type) { @@ -493,7 +493,7 @@ bool CPSPrinterDriver::StartDIBits(const RetainPtr& pBitmap, return false; *handle = nullptr; - return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags); + return m_PSRenderer.DrawDIBits(pBitmap, color, matrix, render_flags); } bool CPSPrinterDriver::DrawDeviceText(int nChars, @@ -598,7 +598,7 @@ bool CTextOnlyPrinterDriver::StartDIBits( const RetainPtr& pBitmap, int bitmap_alpha, uint32_t color, - const CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t render_flags, std::unique_ptr* handle, BlendMode blend_type) { -- cgit v1.2.3