summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-04-12 17:53:15 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-12 17:53:15 +0000
commita8db06a715cd0090a8c838a7b2861ca3c657f6a2 (patch)
treeabb5cb1ac184b65860ca6469e7b060484638a068 /core/fpdfapi
parent822886b0c4478eb339fc5e2ec89f3fbdd78d57be (diff)
downloadpdfium-a8db06a715cd0090a8c838a7b2861ca3c657f6a2.tar.xz
Change CPDF{XFA}_Page::PageToDevice() to take a CFX_PointF.
Instead of taking two doubles. The doubles get casted to floats anyway. Change-Id: Ie16dc60fa5d6412026a5fda08c8c64d4fa2d56c4 Reviewed-on: https://pdfium-review.googlesource.com/30410 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/page/cpdf_page.cpp11
-rw-r--r--core/fpdfapi/page/cpdf_page.h3
2 files changed, 6 insertions, 8 deletions
diff --git a/core/fpdfapi/page/cpdf_page.cpp b/core/fpdfapi/page/cpdf_page.cpp
index 259e8ce0fb..d679766273 100644
--- a/core/fpdfapi/page/cpdf_page.cpp
+++ b/core/fpdfapi/page/cpdf_page.cpp
@@ -126,13 +126,12 @@ Optional<CFX_PointF> CPDF_Page::DeviceToPage(
return page2device.GetInverse().Transform(device_point);
}
-Optional<CFX_PointF> CPDF_Page::PageToDevice(const FX_RECT& rect,
- int rotate,
- double page_x,
- double page_y) const {
+Optional<CFX_PointF> CPDF_Page::PageToDevice(
+ const FX_RECT& rect,
+ int rotate,
+ const CFX_PointF& page_point) const {
CFX_Matrix page2device = GetDisplayMatrix(rect, rotate);
- return page2device.Transform(
- CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)));
+ return page2device.Transform(page_point);
}
CFX_Matrix CPDF_Page::GetDisplayMatrix(const FX_RECT& rect, int iRotate) const {
diff --git a/core/fpdfapi/page/cpdf_page.h b/core/fpdfapi/page/cpdf_page.h
index 34c9ef45a8..0f401ea9b9 100644
--- a/core/fpdfapi/page/cpdf_page.h
+++ b/core/fpdfapi/page/cpdf_page.h
@@ -39,8 +39,7 @@ class CPDF_Page : public CPDF_PageObjectHolder {
const CFX_PointF& device_point) const;
Optional<CFX_PointF> PageToDevice(const FX_RECT& rect,
int rotate,
- double page_x,
- double page_y) const;
+ const CFX_PointF& page_point) const;
CFX_Matrix GetDisplayMatrix(const FX_RECT& rect, int iRotate) const;