summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfview_embeddertest.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-10-31 13:32:17 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-10-31 13:32:17 +0000
commit367e7de07ec33ad045500a04dc2a180390937b27 (patch)
tree1b286d0be1c9e4db933d31c22aceb92aac7f3f7b /fpdfsdk/fpdfview_embeddertest.cpp
parent8aa3002c673f36909560575514b9a9474e5e66bf (diff)
downloadpdfium-367e7de07ec33ad045500a04dc2a180390937b27.tar.xz
Add FS_RECTF conversion functions.
Change-Id: I87fb109fdd121716a170df15c4762496c1ccb88c Reviewed-on: https://pdfium-review.googlesource.com/17210 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfview_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdfview_embeddertest.cpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/fpdfsdk/fpdfview_embeddertest.cpp b/fpdfsdk/fpdfview_embeddertest.cpp
index 699fc8a71b..5fedbfc5ec 100644
--- a/fpdfsdk/fpdfview_embeddertest.cpp
+++ b/fpdfsdk/fpdfview_embeddertest.cpp
@@ -388,23 +388,18 @@ TEST_F(FPDFViewEmbeddertest, FPDF_RenderPageBitmapWithMatrix) {
CompareBitmap(bitmap, initial_width, initial_height, kRotatedMD5[0]);
FPDFBitmap_Destroy(bitmap);
- int width;
- int height;
- FS_RECTF rect;
- rect.left = 0;
- rect.top = 0;
- FS_MATRIX matrix;
-
// Try the easy rotations: 0, 90, 180, 270 clockwise. The output should be the
// same as FPDF_RenderPageBitmap with the appropriate rotation flag. Per PDF
// spec section 4.2.2, a t degree rotation is represented by [cos(t) sin(t)
// -sin(t) cos(t) 0 0] (matrix goes on the right in the multiplication).
- rect.right = initial_width;
- rect.bottom = initial_height;
+ FS_RECTF rect = {0, 0, initial_width, initial_height};
CFX_Matrix rot_matrices[4] = {
CFX_Matrix(1, 0, 0, 1, 0, 0), CFX_Matrix(0, -1, 1, 0, 0, 0),
CFX_Matrix(-1, 0, 0, -1, 0, 0), CFX_Matrix(0, 1, -1, 0, 0, 0)};
for (int rot = 0; rot < 4; ++rot) {
+ int width;
+ int height;
+ FS_MATRIX matrix;
matrix.a = rot_matrices[rot].a;
matrix.b = rot_matrices[rot].b;
matrix.c = rot_matrices[rot].c;
@@ -438,12 +433,9 @@ TEST_F(FPDFViewEmbeddertest, FPDF_RenderPageBitmapWithMatrix) {
// out). pdfium:849
// Now render again with the image scaled smaller.
- width = initial_width / 2;
- height = initial_height / 2;
- matrix.a = 0.5;
- matrix.b = 0;
- matrix.c = 0;
- matrix.d = 0.5;
+ int width = initial_width / 2;
+ int height = initial_height / 2;
+ FS_MATRIX matrix = {0.5, 0, 0, 0.5, 0, 0};
rect.right = width;
rect.bottom = height;