From 4093039d19f832173ec58cfd9f2e8ac393a76091 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 15 Feb 2017 11:10:16 -0500 Subject: Cleanup GetZeroAreaPath method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL simplifies some of the logic in GetZeroAreaPath. It also removes the side effect of resetting the object device matrix. Change-Id: Id1e355bde811341c5ceab0331fbe64b1aed895d5 Reviewed-on: https://pdfium-review.googlesource.com/2712 Reviewed-by: Nicolás Peña Commit-Queue: dsinclair --- core/fxge/ge/cfx_renderdevice.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'core/fxge/ge/cfx_renderdevice.cpp') diff --git a/core/fxge/ge/cfx_renderdevice.cpp b/core/fxge/ge/cfx_renderdevice.cpp index b0be4667e3..d2c677ecc2 100644 --- a/core/fxge/ge/cfx_renderdevice.cpp +++ b/core/fxge/ge/cfx_renderdevice.cpp @@ -535,19 +535,25 @@ bool CFX_RenderDevice::DrawPathWithBlend(const CFX_PathData* pPathData, !(fill_mode & FX_FILL_TEXT_MODE)) { CFX_PathData newPath; bool bThin = false; - if (pPathData->GetZeroAreaPath(&newPath, (CFX_Matrix*)pObject2Device, bThin, - !!m_pDeviceDriver->GetDriverType())) { + bool setIdentity = false; + if (pPathData->GetZeroAreaPath(pObject2Device, + !!m_pDeviceDriver->GetDriverType(), &newPath, + &bThin, &setIdentity)) { CFX_GraphStateData graphState; graphState.m_LineWidth = 0.0f; + uint32_t strokecolor = fill_color; if (bThin) strokecolor = (((fill_alpha >> 2) << 24) | (strokecolor & 0x00ffffff)); - CFX_Matrix* pMatrix = nullptr; - if (pObject2Device && !pObject2Device->IsIdentity()) - pMatrix = (CFX_Matrix*)pObject2Device; + + const CFX_Matrix* pMatrix = nullptr; + if (pObject2Device && !pObject2Device->IsIdentity() && !setIdentity) + pMatrix = pObject2Device; + int smooth_path = FX_ZEROAREA_FILL; if (fill_mode & FXFILL_NOPATHSMOOTH) smooth_path |= FXFILL_NOPATHSMOOTH; + m_pDeviceDriver->DrawPath(&newPath, pMatrix, &graphState, 0, strokecolor, smooth_path, blend_type); } -- cgit v1.2.3