summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_view.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-04-12 15:50:49 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-12 15:50:49 +0000
commitc4242b24262d082f3ad70805aca779a3ff540c2c (patch)
tree5c9f666d4ae62ed728217bd8dcf3f3306905e328 /fpdfsdk/fpdf_view.cpp
parent1c23a6d78c95ff0714cda6f642420e0502edac29 (diff)
downloadpdfium-c4242b24262d082f3ad70805aca779a3ff540c2c.tar.xz
Change GetDisplayMatrix methods to take FX_RECT.
Change-Id: I079bc3bf1242fd28fdd51930d9deb6efa34d7509 Reviewed-on: https://pdfium-review.googlesource.com/30055 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_view.cpp')
-rw-r--r--fpdfsdk/fpdf_view.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp
index 2b4600dc8a..b04276ee51 100644
--- a/fpdfsdk/fpdf_view.cpp
+++ b/fpdfsdk/fpdf_view.cpp
@@ -657,8 +657,8 @@ FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap,
clipping_rect = CFXFloatRectFromFSRECTF(*clipping);
FX_RECT clip_rect = clipping_rect.ToFxRect();
- CFX_Matrix transform_matrix = pPage->GetDisplayMatrix(
- 0, 0, pPage->GetPageWidth(), pPage->GetPageHeight(), 0);
+ const FX_RECT rect(0, 0, pPage->GetPageWidth(), pPage->GetPageHeight());
+ CFX_Matrix transform_matrix = pPage->GetDisplayMatrix(rect, 0);
if (matrix) {
transform_matrix.Concat(CFX_Matrix(matrix->a, matrix->b, matrix->c,
@@ -748,8 +748,8 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_DeviceToPage(FPDF_PAGE page,
pPage->DeviceToPage(start_x, start_y, size_x, size_y, rotate, device_x,
device_y, page_x, page_y);
#else // PDF_ENABLE_XFA
- CFX_Matrix page2device =
- pPage->GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate);
+ const FX_RECT rect(start_x, start_y, start_x + size_x, start_y + size_y);
+ CFX_Matrix page2device = pPage->GetDisplayMatrix(rect, rotate);
CFX_PointF pos = page2device.GetInverse().Transform(
CFX_PointF(static_cast<float>(device_x), static_cast<float>(device_y)));
@@ -778,8 +778,8 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_PageToDevice(FPDF_PAGE page,
pPage->PageToDevice(start_x, start_y, size_x, size_y, rotate, page_x, page_y,
device_x, device_y);
#else // PDF_ENABLE_XFA
- CFX_Matrix page2device =
- pPage->GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate);
+ const FX_RECT rect(start_x, start_y, start_x + size_x, start_y + size_y);
+ CFX_Matrix page2device = pPage->GetDisplayMatrix(rect, rotate);
CFX_PointF pos = page2device.Transform(
CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)));
@@ -898,11 +898,9 @@ void FPDF_RenderPage_Retail(CPDF_PageRenderContext* pContext,
if (!pPage)
return;
- RenderPageImpl(
- pContext, pPage,
- pPage->GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate),
- FX_RECT(start_x, start_y, start_x + size_x, start_y + size_y), flags,
- bNeedToRestore, pause);
+ const FX_RECT rect(start_x, start_y, start_x + size_x, start_y + size_y);
+ RenderPageImpl(pContext, pPage, pPage->GetDisplayMatrix(rect, rotate), rect,
+ flags, bNeedToRestore, pause);
}
FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document,