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/cfx_psrenderer.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'core/fxge/win32/cfx_psrenderer.cpp') diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp index 921005dd70..becf99b52d 100644 --- a/core/fxge/win32/cfx_psrenderer.cpp +++ b/core/fxge/win32/cfx_psrenderer.cpp @@ -348,7 +348,7 @@ bool CFX_PSRenderer::SetDIBits(const RetainPtr& pSource, CFX_Matrix matrix((float)(pSource->GetWidth()), 0.0f, 0.0f, -(float)(pSource->GetHeight()), (float)(left), (float)(top + pSource->GetHeight())); - return DrawDIBits(pSource, color, &matrix, 0); + return DrawDIBits(pSource, color, matrix, 0); } bool CFX_PSRenderer::StretchDIBits(const RetainPtr& pSource, @@ -361,18 +361,17 @@ bool CFX_PSRenderer::StretchDIBits(const RetainPtr& pSource, StartRendering(); CFX_Matrix matrix((float)(dest_width), 0.0f, 0.0f, (float)(-dest_height), (float)(dest_left), (float)(dest_top + dest_height)); - return DrawDIBits(pSource, color, &matrix, flags); + return DrawDIBits(pSource, color, matrix, flags); } bool CFX_PSRenderer::DrawDIBits(const RetainPtr& pSource, uint32_t color, - const CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t flags) { StartRendering(); - if ((pMatrix->a == 0 && pMatrix->b == 0) || - (pMatrix->c == 0 && pMatrix->d == 0)) { + if ((matrix.a == 0 && matrix.b == 0) || (matrix.c == 0 && matrix.d == 0)) return true; - } + if (pSource->HasAlpha()) return false; @@ -383,8 +382,8 @@ bool CFX_PSRenderer::DrawDIBits(const RetainPtr& pSource, m_pStream->WriteString("q\n"); std::ostringstream buf; - buf << "[" << pMatrix->a << " " << pMatrix->b << " " << pMatrix->c << " " - << pMatrix->d << " " << pMatrix->e << " " << pMatrix->f << "]cm "; + buf << "[" << matrix.a << " " << matrix.b << " " << matrix.c << " " + << matrix.d << " " << matrix.e << " " << matrix.f << "]cm "; int width = pSource->GetWidth(); int height = pSource->GetHeight(); -- cgit v1.2.3