summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-01-26 15:32:19 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-26 15:32:19 +0000
commit30f213e89d4e7ff67e09eaae592614cddba0809a (patch)
tree4919b4766f3d0c5432aba6f001d3a10501246b22
parentb0f33f284832a49026787f9ee07750dd04fedc4d (diff)
downloadpdfium-30f213e89d4e7ff67e09eaae592614cddba0809a.tar.xz
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 <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp17
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.h4
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,