From 30f213e89d4e7ff67e09eaae592614cddba0809a Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 26 Jan 2018 15:32:19 +0000 Subject: Change CPDF_RenderStatus::ProcessPathPattern() to pass by pointer. Avoid passing by non-const ref. Change-Id: I05bfdd918b334d775c5ce50eebb8328630626896 Reviewed-on: https://pdfium-review.googlesource.com/24170 Commit-Queue: Ryan Harrison Reviewed-by: Ryan Harrison --- core/fpdfapi/render/cpdf_renderstatus.cpp | 17 ++++++++++------- core/fpdfapi/render/cpdf_renderstatus.h | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index 8899867354..66688a2d4c 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -1305,7 +1305,7 @@ bool CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device) { int FillType = pPathObj->m_FillType; bool bStroke = pPathObj->m_bStroke; - ProcessPathPattern(pPathObj, pObj2Device, FillType, bStroke); + ProcessPathPattern(pPathObj, pObj2Device, &FillType, &bStroke); if (FillType == 0 && !bStroke) return true; @@ -2414,20 +2414,23 @@ void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj, void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device, - int& filltype, - bool& bStroke) { - if (filltype) { + int* filltype, + bool* bStroke) { + ASSERT(filltype); + ASSERT(bStroke); + + if (*filltype) { const CPDF_Color& FillColor = *pPathObj->m_ColorState.GetFillColor(); if (FillColor.IsPattern()) { DrawPathWithPattern(pPathObj, pObj2Device, &FillColor, false); - filltype = 0; + *filltype = 0; } } - if (bStroke) { + if (*bStroke) { const CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); if (StrokeColor.IsPattern()) { DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, true); - bStroke = false; + *bStroke = false; } } } diff --git a/core/fpdfapi/render/cpdf_renderstatus.h b/core/fpdfapi/render/cpdf_renderstatus.h index c8b7b09017..8008092766 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.h +++ b/core/fpdfapi/render/cpdf_renderstatus.h @@ -109,8 +109,8 @@ class CPDF_RenderStatus { bool ProcessPath(CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device); void ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device, - int& filltype, - bool& bStroke); + int* filltype, + bool* bStroke); void DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device, const CPDF_Color* pColor, -- cgit v1.2.3