diff options
author | dan sinclair <dsinclair@chromium.org> | 2017-02-22 19:56:15 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-23 01:17:40 +0000 |
commit | b147e07ee36be10ca0796a6566be107077c21a03 (patch) | |
tree | 637b1b206000a88fb3e198f648e86a9ee5178f1b /core/fxge/win32/cfx_psrenderer.cpp | |
parent | e3f237740fd8bea50b4a6f37f56455dfa0328546 (diff) | |
download | pdfium-b147e07ee36be10ca0796a6566be107077c21a03.tar.xz |
Convert point x,y into CFX_PointF
This Cl converts the PointX,PointY pairs into a CFX_PointF.
Change-Id: I46897832077c317a5bffb4e568550705decbc40c
Reviewed-on: https://pdfium-review.googlesource.com/2821
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/win32/cfx_psrenderer.cpp')
-rw-r--r-- | core/fxge/win32/cfx_psrenderer.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp index a0e675e23c..74fae088d9 100644 --- a/core/fxge/win32/cfx_psrenderer.cpp +++ b/core/fxge/win32/cfx_psrenderer.cpp @@ -116,7 +116,7 @@ void CFX_PSRenderer::OutputPath(const CFX_PathData* pPathData, for (size_t i = 0; i < size; i++) { FXPT_TYPE type = pPathData->GetType(i); bool closing = pPathData->IsClosingFigure(i); - CFX_PointF pos(pPathData->GetPointX(i), pPathData->GetPointY(i)); + CFX_PointF pos = pPathData->GetPoint(i); if (pObject2Device) pos = pObject2Device->Transform(pos); @@ -131,10 +131,8 @@ void CFX_PSRenderer::OutputPath(const CFX_PathData* pPathData, buf << "h "; break; case FXPT_TYPE::BezierTo: { - CFX_PointF pos1(pPathData->GetPointX(i + 1), - pPathData->GetPointY(i + 1)); - CFX_PointF pos2(pPathData->GetPointX(i + 2), - pPathData->GetPointY(i + 2)); + CFX_PointF pos1 = pPathData->GetPoint(i + 1); + CFX_PointF pos2 = pPathData->GetPoint(i + 2); if (pObject2Device) { pos1 = pObject2Device->Transform(pos1); pos2 = pObject2Device->Transform(pos2); @@ -604,21 +602,21 @@ void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache, buf << "/X" << *ps_fontnum << " Ff/CharProcs get begin/" << glyphindex << "{n "; for (size_t p = 0; p < TransformedPath.GetPoints().size(); p++) { - FX_FLOAT x = TransformedPath.GetPointX(p), y = TransformedPath.GetPointY(p); + CFX_PointF point = TransformedPath.GetPoint(p); switch (TransformedPath.GetType(p)) { case FXPT_TYPE::MoveTo: { - buf << x << " " << y << " m\n"; + buf << point.x << " " << point.y << " m\n"; break; } case FXPT_TYPE::LineTo: { - buf << x << " " << y << " l\n"; + buf << point.x << " " << point.y << " l\n"; break; } case FXPT_TYPE::BezierTo: { - buf << x << " " << y << " " << TransformedPath.GetPointX(p + 1) << " " - << TransformedPath.GetPointY(p + 1) << " " - << TransformedPath.GetPointX(p + 2) << " " - << TransformedPath.GetPointY(p + 2) << " c\n"; + CFX_PointF point1 = TransformedPath.GetPoint(p + 1); + CFX_PointF point2 = TransformedPath.GetPoint(p + 2); + buf << point.x << " " << point.y << " " << point1.x << " " << point1.y + << " " << point2.x << " " << point2.y << " c\n"; p += 2; break; } |