summaryrefslogtreecommitdiff
path: root/core/fxge/ge
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-21 12:56:24 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-21 19:05:18 +0000
commit1f403cee9478021862c7cc4e516907bd51e8f0f6 (patch)
tree57829fa3b036ee9ddd57a8ad5b3541fe4e96fdb8 /core/fxge/ge
parent04557b8a7c2d3dab06fe9eadacc3c7744b3e14e2 (diff)
downloadpdfium-1f403cee9478021862c7cc4e516907bd51e8f0f6.tar.xz
Convert more TransformPoint calls to Transform
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 <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fxge/ge')
-rw-r--r--core/fxge/ge/cfx_pathdata.cpp18
-rw-r--r--core/fxge/ge/cfx_renderdevice.cpp13
2 files changed, 14 insertions, 17 deletions
diff --git a/core/fxge/ge/cfx_pathdata.cpp b/core/fxge/ge/cfx_pathdata.cpp
index 11c421e468..e06eadd6ce 100644
--- a/core/fxge/ge/cfx_pathdata.cpp
+++ b/core/fxge/ge/cfx_pathdata.cpp
@@ -452,26 +452,24 @@ bool CFX_PathData::IsRect(const CFX_Matrix* pMatrix,
return false;
}
- FX_FLOAT x[5];
- FX_FLOAT y[5];
+ CFX_PointF points[5];
for (size_t i = 0; i < m_Points.size(); i++) {
- x[i] = m_Points[i].m_PointX;
- y[i] = m_Points[i].m_PointY;
- pMatrix->TransformPoint(x[i], y[i]);
+ points[i] = pMatrix->Transform(
+ CFX_PointF(m_Points[i].m_PointX, m_Points[i].m_PointY));
if (i == 0)
continue;
if (m_Points[i].m_Type != FXPT_TYPE::LineTo)
return false;
- if (x[i] != x[i - 1] && y[i] != y[i - 1])
+ if (points[i].x != points[i - 1].x && points[i].y != points[i - 1].y)
return false;
}
if (pRect) {
- pRect->left = x[0];
- pRect->right = x[2];
- pRect->bottom = y[0];
- pRect->top = y[2];
+ pRect->left = points[0].x;
+ pRect->right = points[2].x;
+ pRect->bottom = points[0].y;
+ pRect->top = points[2].y;
pRect->Normalize();
}
return true;
diff --git a/core/fxge/ge/cfx_renderdevice.cpp b/core/fxge/ge/cfx_renderdevice.cpp
index 86e74cafc4..203fecf061 100644
--- a/core/fxge/ge/cfx_renderdevice.cpp
+++ b/core/fxge/ge/cfx_renderdevice.cpp
@@ -490,15 +490,14 @@ bool CFX_RenderDevice::DrawPathWithBlend(const CFX_PathData* pPathData,
uint8_t fill_alpha = (fill_mode & 3) ? FXARGB_A(fill_color) : 0;
const std::vector<FX_PATHPOINT>& pPoints = pPathData->GetPoints();
if (stroke_alpha == 0 && pPoints.size() == 2) {
- FX_FLOAT x1 = pPoints[0].m_PointX;
- FX_FLOAT y1 = pPoints[0].m_PointY;
- FX_FLOAT x2 = pPoints[1].m_PointX;
- FX_FLOAT y2 = pPoints[1].m_PointY;
+ CFX_PointF pos1(pPoints[0].m_PointX, pPoints[0].m_PointY);
+ CFX_PointF pos2(pPoints[1].m_PointX, pPoints[1].m_PointY);
if (pObject2Device) {
- pObject2Device->TransformPoint(x1, y1);
- pObject2Device->TransformPoint(x2, y2);
+ pos1 = pObject2Device->Transform(pos1);
+ pos2 = pObject2Device->Transform(pos2);
}
- DrawCosmeticLine(x1, y1, x2, y2, fill_color, fill_mode, blend_type);
+ DrawCosmeticLine(pos1.x, pos1.y, pos2.x, pos2.y, fill_color, fill_mode,
+ blend_type);
return true;
}