summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfview.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-07-26 13:50:12 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-26 19:56:53 +0000
commit60bde10736fd78a2333cf1513aea779df9346b35 (patch)
treeed792453114a14937c0be4169a972e633ddf1a08 /fpdfsdk/fpdfview.cpp
parente9af3798cbee81bc0093d4be024ecb6c2ea19bd9 (diff)
downloadpdfium-60bde10736fd78a2333cf1513aea779df9346b35.tar.xz
Fix FPDF_RenderPageBitmapWithMatrix
This CL fixes FPDF_RenderPageBitmapWithMatrix and improves tests. Bug: pdfium:837 Change-Id: I98f90b667cc9a50fb0e915b8a758603488b44d40 Reviewed-on: https://pdfium-review.googlesource.com/9010 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfview.cpp')
-rw-r--r--fpdfsdk/fpdfview.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 956e6db671..c51ee90fe0 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -967,12 +967,6 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap,
CFX_RetainPtr<CFX_DIBitmap> pBitmap(CFXBitmapFromFPDFBitmap(bitmap));
pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
- CFX_Matrix transform_matrix = pPage->GetPageMatrix();
- if (matrix) {
- transform_matrix.Concat(CFX_Matrix(matrix->a, matrix->b, matrix->c,
- matrix->d, matrix->e, matrix->f));
- }
-
CFX_FloatRect clipping_rect;
if (clipping) {
clipping_rect.left = clipping->left;
@@ -980,8 +974,16 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap,
clipping_rect.right = clipping->right;
clipping_rect.top = clipping->top;
}
- RenderPageImpl(pContext, pPage, transform_matrix, clipping_rect.ToFxRect(),
- flags, true, nullptr);
+ FX_RECT clip_rect = clipping_rect.ToFxRect();
+
+ CFX_Matrix transform_matrix = pPage->GetDisplayMatrix(
+ clip_rect.left, clip_rect.top, clip_rect.Width(), clip_rect.Height(), 0);
+ if (matrix) {
+ transform_matrix.Concat(CFX_Matrix(matrix->a, matrix->b, matrix->c,
+ matrix->d, matrix->e, matrix->f));
+ }
+ RenderPageImpl(pContext, pPage, transform_matrix, clip_rect, flags, true,
+ nullptr);
pPage->SetRenderContext(nullptr);
}