diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-02-15 11:10:16 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-15 18:10:40 +0000 |
commit | 4093039d19f832173ec58cfd9f2e8ac393a76091 (patch) | |
tree | d39987d19bfc1d66aee3c88b58e6b8236c6ec65a /core/fxge/ge/cfx_renderdevice.cpp | |
parent | e4602321f3175fa5addb6761d0e94f5c2fc93d0c (diff) | |
download | pdfium-4093039d19f832173ec58cfd9f2e8ac393a76091.tar.xz |
Cleanup GetZeroAreaPath methodchromium/3014
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 <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge/ge/cfx_renderdevice.cpp')
-rw-r--r-- | core/fxge/ge/cfx_renderdevice.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
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); } |