summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-18 17:51:42 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-18 17:51:42 +0000
commitb8fd43f9ca1ec790ef16590dbd909b81c3e09580 (patch)
treef65a4c41fe7eb6636825df18853a659387b1e30a
parent0233af4f241c712b41a5d5dfc337cdfce8c63bc9 (diff)
downloadpdfium-b8fd43f9ca1ec790ef16590dbd909b81c3e09580.tar.xz
Avoid pass by value in FPDFPage_Flatten()'s GetMatrix() helper.
Change-Id: I281ca39655d593264d9b0ae074d4faec2f36d01c Reviewed-on: https://pdfium-review.googlesource.com/c/44253 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
-rw-r--r--fpdfsdk/fpdf_flatten.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index 0cee611144..58074bd7f7 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -225,21 +225,21 @@ void SetPageContents(const ByteString& key,
}
}
-CFX_Matrix GetMatrix(CFX_FloatRect rcAnnot,
- CFX_FloatRect rcStream,
+CFX_Matrix GetMatrix(const CFX_FloatRect& rcAnnot,
+ const CFX_FloatRect& rcStream,
const CFX_Matrix& matrix) {
if (rcStream.IsEmpty())
return CFX_Matrix();
- rcStream = matrix.TransformRect(rcStream);
- rcStream.Normalize();
+ CFX_FloatRect rcTransformed = matrix.TransformRect(rcStream);
+ rcTransformed.Normalize();
- float a = rcAnnot.Width() / rcStream.Width();
- float d = rcAnnot.Height() / rcStream.Height();
+ float a = rcAnnot.Width() / rcTransformed.Width();
+ float d = rcAnnot.Height() / rcTransformed.Height();
- float e = rcAnnot.left - rcStream.left * a;
- float f = rcAnnot.bottom - rcStream.bottom * d;
- return CFX_Matrix(a, 0, 0, d, e, f);
+ float e = rcAnnot.left - rcTransformed.left * a;
+ float f = rcAnnot.bottom - rcTransformed.bottom * d;
+ return CFX_Matrix(a, 0.0f, 0.0f, d, e, f);
}
} // namespace