From bba2a7cf30da9e84bcc14ef32dbb0bb944229219 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 7 Feb 2017 16:36:39 -0500 Subject: Update to use CFX_Rect{F} and CFX_Matrix constructors. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Cl updates the code to use the constructors instead of creating an empty object and calling Set(). It also removes the various memsets of the CFX_Rect{F} classes. Change-Id: I6e20cec00866a38372858dcba5a30d31103172e4 Reviewed-on: https://pdfium-review.googlesource.com/2550 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña Reviewed-by: Tom Sepez --- core/fpdfapi/page/cpdf_page.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'core/fpdfapi/page/cpdf_page.cpp') diff --git a/core/fpdfapi/page/cpdf_page.cpp b/core/fpdfapi/page/cpdf_page.cpp index f9c02837a7..7714369df8 100644 --- a/core/fpdfapi/page/cpdf_page.cpp +++ b/core/fpdfapi/page/cpdf_page.cpp @@ -66,16 +66,17 @@ CPDF_Page::CPDF_Page(CPDF_Document* pDocument, switch (rotate) { case 0: - m_PageMatrix.Set(1.0f, 0, 0, 1.0f, -m_BBox.left, -m_BBox.bottom); + m_PageMatrix = CFX_Matrix(1.0f, 0, 0, 1.0f, -m_BBox.left, -m_BBox.bottom); break; case 1: - m_PageMatrix.Set(0, -1.0f, 1.0f, 0, -m_BBox.bottom, m_BBox.right); + m_PageMatrix = + CFX_Matrix(0, -1.0f, 1.0f, 0, -m_BBox.bottom, m_BBox.right); break; case 2: - m_PageMatrix.Set(-1.0f, 0, 0, -1.0f, m_BBox.right, m_BBox.top); + m_PageMatrix = CFX_Matrix(-1.0f, 0, 0, -1.0f, m_BBox.right, m_BBox.top); break; case 3: - m_PageMatrix.Set(0, 1.0f, -1.0f, 0, m_BBox.top, -m_BBox.left); + m_PageMatrix = CFX_Matrix(0, 1.0f, -1.0f, 0, m_BBox.top, -m_BBox.left); break; } @@ -128,7 +129,6 @@ void CPDF_Page::GetDisplayMatrix(CFX_Matrix& matrix, if (m_PageWidth == 0 || m_PageHeight == 0) { return; } - CFX_Matrix display_matrix; float x0 = 0; float y0 = 0; float x1 = 0; @@ -170,9 +170,8 @@ void CPDF_Page::GetDisplayMatrix(CFX_Matrix& matrix, y2 = yPos; break; } - display_matrix.Set((x2 - x0) / m_PageWidth, (y2 - y0) / m_PageWidth, - (x1 - x0) / m_PageHeight, (y1 - y0) / m_PageHeight, x0, - y0); matrix = m_PageMatrix; - matrix.Concat(display_matrix); + matrix.Concat(CFX_Matrix((x2 - x0) / m_PageWidth, (y2 - y0) / m_PageWidth, + (x1 - x0) / m_PageHeight, (y1 - y0) / m_PageHeight, + x0, y0)); } -- cgit v1.2.3