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/ge/cfx_font.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/ge/cfx_font.cpp')
-rw-r--r-- | core/fxge/ge/cfx_font.cpp | 56 |
1 files changed, 26 insertions, 30 deletions
diff --git a/core/fxge/ge/cfx_font.cpp b/core/fxge/ge/cfx_font.cpp index ef6960a3d7..87157b0101 100644 --- a/core/fxge/ge/cfx_font.cpp +++ b/core/fxge/ge/cfx_font.cpp @@ -88,18 +88,14 @@ void Outline_CheckEmptyContour(OUTLINE_PARAMS* param) { size_t size = points.size(); if (size >= 2 && points[size - 2].IsTypeAndOpen(FXPT_TYPE::MoveTo) && - points[size - 2].m_PointX == points[size - 1].m_PointX && - points[size - 2].m_PointY == points[size - 1].m_PointY) { + points[size - 2].m_Point == points[size - 1].m_Point) { size -= 2; } if (size >= 4 && points[size - 4].IsTypeAndOpen(FXPT_TYPE::MoveTo) && points[size - 3].IsTypeAndOpen(FXPT_TYPE::BezierTo) && - points[size - 3].m_PointX == points[size - 4].m_PointX && - points[size - 3].m_PointY == points[size - 4].m_PointY && - points[size - 2].m_PointX == points[size - 4].m_PointX && - points[size - 2].m_PointY == points[size - 4].m_PointY && - points[size - 1].m_PointX == points[size - 4].m_PointX && - points[size - 1].m_PointY == points[size - 4].m_PointY) { + points[size - 3].m_Point == points[size - 4].m_Point && + points[size - 2].m_Point == points[size - 4].m_Point && + points[size - 1].m_Point == points[size - 4].m_Point) { size -= 4; } points.resize(size); @@ -111,9 +107,9 @@ int Outline_MoveTo(const FXFT_Vector* to, void* user) { Outline_CheckEmptyContour(param); param->m_pPath->ClosePath(); - param->m_pPath->AppendPoint(to->x / param->m_CoordUnit, - to->y / param->m_CoordUnit, FXPT_TYPE::MoveTo, - false); + param->m_pPath->AppendPoint( + CFX_PointF(to->x / param->m_CoordUnit, to->y / param->m_CoordUnit), + FXPT_TYPE::MoveTo, false); param->m_CurX = to->x; param->m_CurY = to->y; @@ -123,9 +119,9 @@ int Outline_MoveTo(const FXFT_Vector* to, void* user) { int Outline_LineTo(const FXFT_Vector* to, void* user) { OUTLINE_PARAMS* param = (OUTLINE_PARAMS*)user; - param->m_pPath->AppendPoint(to->x / param->m_CoordUnit, - to->y / param->m_CoordUnit, FXPT_TYPE::LineTo, - false); + param->m_pPath->AppendPoint( + CFX_PointF(to->x / param->m_CoordUnit, to->y / param->m_CoordUnit), + FXPT_TYPE::LineTo, false); param->m_CurX = to->x; param->m_CurY = to->y; @@ -138,20 +134,20 @@ int Outline_ConicTo(const FXFT_Vector* control, OUTLINE_PARAMS* param = (OUTLINE_PARAMS*)user; param->m_pPath->AppendPoint( - (param->m_CurX + (control->x - param->m_CurX) * 2 / 3) / - param->m_CoordUnit, - (param->m_CurY + (control->y - param->m_CurY) * 2 / 3) / - param->m_CoordUnit, + CFX_PointF((param->m_CurX + (control->x - param->m_CurX) * 2 / 3) / + param->m_CoordUnit, + (param->m_CurY + (control->y - param->m_CurY) * 2 / 3) / + param->m_CoordUnit), FXPT_TYPE::BezierTo, false); param->m_pPath->AppendPoint( - (control->x + (to->x - control->x) / 3) / param->m_CoordUnit, - (control->y + (to->y - control->y) / 3) / param->m_CoordUnit, + CFX_PointF((control->x + (to->x - control->x) / 3) / param->m_CoordUnit, + (control->y + (to->y - control->y) / 3) / param->m_CoordUnit), FXPT_TYPE::BezierTo, false); - param->m_pPath->AppendPoint(to->x / param->m_CoordUnit, - to->y / param->m_CoordUnit, FXPT_TYPE::BezierTo, - false); + param->m_pPath->AppendPoint( + CFX_PointF(to->x / param->m_CoordUnit, to->y / param->m_CoordUnit), + FXPT_TYPE::BezierTo, false); param->m_CurX = to->x; param->m_CurY = to->y; @@ -164,17 +160,17 @@ int Outline_CubicTo(const FXFT_Vector* control1, void* user) { OUTLINE_PARAMS* param = (OUTLINE_PARAMS*)user; - param->m_pPath->AppendPoint(control1->x / param->m_CoordUnit, - control1->y / param->m_CoordUnit, + param->m_pPath->AppendPoint(CFX_PointF(control1->x / param->m_CoordUnit, + control1->y / param->m_CoordUnit), FXPT_TYPE::BezierTo, false); - param->m_pPath->AppendPoint(control2->x / param->m_CoordUnit, - control2->y / param->m_CoordUnit, + param->m_pPath->AppendPoint(CFX_PointF(control2->x / param->m_CoordUnit, + control2->y / param->m_CoordUnit), FXPT_TYPE::BezierTo, false); - param->m_pPath->AppendPoint(to->x / param->m_CoordUnit, - to->y / param->m_CoordUnit, FXPT_TYPE::BezierTo, - false); + param->m_pPath->AppendPoint( + CFX_PointF(to->x / param->m_CoordUnit, to->y / param->m_CoordUnit), + FXPT_TYPE::BezierTo, false); param->m_CurX = to->x; param->m_CurY = to->y; |