diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-02-09 13:07:43 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-09 19:02:55 +0000 |
commit | afb44560a21298b3588b36cbaf45e2be50f2e75b (patch) | |
tree | 21f3ececad017e6be64a19c4370cfe9fd7f9c29c /core/fxge/win32/fx_win32_gdipext.cpp | |
parent | 67e4faaf8be0aebc67ebfb96d33933d9f9119d20 (diff) | |
download | pdfium-afb44560a21298b3588b36cbaf45e2be50f2e75b.tar.xz |
Remove Transform in favour of TransformPoint
This CL removes the two Transform() overrides from CFX_Matrix and calls the
TransformPoint methods directly. In the case of the 4 param version the
values were assigned to the out values before calling.
Change-Id: Id633826caec75b848774dcda6cfdcef2dbf5a7db
Reviewed-on: https://pdfium-review.googlesource.com/2573
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge/win32/fx_win32_gdipext.cpp')
-rw-r--r-- | core/fxge/win32/fx_win32_gdipext.cpp | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/core/fxge/win32/fx_win32_gdipext.cpp b/core/fxge/win32/fx_win32_gdipext.cpp index 65f7b3e732..c703e3e300 100644 --- a/core/fxge/win32/fx_win32_gdipext.cpp +++ b/core/fxge/win32/fx_win32_gdipext.cpp @@ -1083,8 +1083,8 @@ static bool IsSmallTriangle(PointF* points, FX_FLOAT x1 = points[pair1].X, x2 = points[pair2].X; FX_FLOAT y1 = points[pair1].Y, y2 = points[pair2].Y; if (pMatrix) { - pMatrix->Transform(x1, y1); - pMatrix->Transform(x2, y2); + pMatrix->TransformPoint(x1, y1); + pMatrix->TransformPoint(x2, y2); } FX_FLOAT dx = x1 - x2; FX_FLOAT dy = y1 - y2; @@ -1132,25 +1132,20 @@ bool CGdiplusExt::DrawPath(HDC hDC, for (int i = 0; i < nPoints; i++) { points[i].X = pPoints[i].m_PointX; points[i].Y = pPoints[i].m_PointY; - FX_FLOAT x, y; - if (pObject2Device) { - pObject2Device->Transform(pPoints[i].m_PointX, pPoints[i].m_PointY, x, y); - } else { - x = pPoints[i].m_PointX; - y = pPoints[i].m_PointY; - } - if (x > 50000 * 1.0f) { + FX_FLOAT x = pPoints[i].m_PointX; + FX_FLOAT y = pPoints[i].m_PointY; + if (pObject2Device) + pObject2Device->TransformPoint(x, y); + + if (x > 50000 * 1.0f) points[i].X = 50000 * 1.0f; - } - if (x < -50000 * 1.0f) { + if (x < -50000 * 1.0f) points[i].X = -50000 * 1.0f; - } - if (y > 50000 * 1.0f) { + if (y > 50000 * 1.0f) points[i].Y = 50000 * 1.0f; - } - if (y < -50000 * 1.0f) { + if (y < -50000 * 1.0f) points[i].Y = -50000 * 1.0f; - } + FXPT_TYPE point_type = pPoints[i].m_Type; if (point_type == FXPT_TYPE::MoveTo) { types[i] = PathPointTypeStart; |