From 1f403cee9478021862c7cc4e516907bd51e8f0f6 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 21 Feb 2017 12:56:24 -0500 Subject: Convert more TransformPoint calls to Transform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Cl converts several uses of TransformPoint to use Transform(CFX_PointF). Change-Id: I9bc3c484e0a4304b904584218bd9e59dec7db727 Reviewed-on: https://pdfium-review.googlesource.com/2791 Commit-Queue: dsinclair Reviewed-by: Tom Sepez Reviewed-by: Nicolás Peña --- core/fpdfapi/page/cpdf_meshstream.cpp | 6 ++---- core/fpdfapi/render/cpdf_renderstatus.cpp | 10 ++++------ 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'core/fpdfapi') diff --git a/core/fpdfapi/page/cpdf_meshstream.cpp b/core/fpdfapi/page/cpdf_meshstream.cpp index fbbd22276f..75069cab7f 100644 --- a/core/fpdfapi/page/cpdf_meshstream.cpp +++ b/core/fpdfapi/page/cpdf_meshstream.cpp @@ -214,8 +214,7 @@ CPDF_MeshVertex CPDF_MeshStream::ReadVertex(const CFX_Matrix& pObject2Bitmap, *flag = ReadFlag(); CPDF_MeshVertex vertex; - vertex.position = ReadCoords(); - pObject2Bitmap.TransformPoint(vertex.position.x, vertex.position.y); + vertex.position = pObject2Bitmap.Transform(ReadCoords()); std::tie(vertex.r, vertex.g, vertex.b) = ReadColor(); m_BitStream.ByteAlign(); @@ -229,8 +228,7 @@ bool CPDF_MeshStream::ReadVertexRow(const CFX_Matrix& pObject2Bitmap, if (m_BitStream.IsEOF()) return false; - vertex[i].position = ReadCoords(); - pObject2Bitmap.TransformPoint(vertex[i].position.x, vertex[i].position.y); + vertex[i].position = pObject2Bitmap.Transform(ReadCoords()); std::tie(vertex[i].r, vertex[i].g, vertex[i].b) = ReadColor(); m_BitStream.ByteAlign(); } diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index 5a340cd8b1..b041a72662 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -2228,13 +2228,11 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, for (int col = min_col; col <= max_col; col++) for (int row = min_row; row <= max_row; row++) { - FX_FLOAT orig_x, orig_y; - orig_x = col * pPattern->x_step(); - orig_y = row * pPattern->y_step(); - mtPattern2Device.TransformPoint(orig_x, orig_y); + CFX_PointF original = mtPattern2Device.Transform( + CFX_PointF(col * pPattern->x_step(), row * pPattern->y_step())); CFX_Matrix matrix = *pObj2Device; - matrix.Translate(orig_x - mtPattern2Device.e, - orig_y - mtPattern2Device.f); + matrix.Translate(original.x - mtPattern2Device.e, + original.y - mtPattern2Device.f); m_pDevice->SaveState(); CPDF_RenderStatus status; status.Initialize(m_pContext, m_pDevice, nullptr, nullptr, this, -- cgit v1.2.3