From 79365f7e3d2d62138e79e4403d4959318776c139 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Tue, 7 Feb 2017 14:21:36 -0500 Subject: Use enum class for PathPoint types. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This hopefully makes it less confusing what the description of a point is. Currently we have defines for the types, which is confusing because a point can only be one of the three. And it is mixed up with whether the point is closing a figure or not. Change-Id: Icd71355d69c77b3d52ca78e03bc379081ff87753 Reviewed-on: https://pdfium-review.googlesource.com/2552 Commit-Queue: Nicolás Peña Reviewed-by: Tom Sepez --- core/fxge/skia/fx_skia_device.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core/fxge/skia') diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 2a004836af..40bd321f56 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -289,18 +289,18 @@ SkPath BuildPath(const CFX_PathData* pPathData) { for (int i = 0; i < nPoints; i++) { FX_FLOAT x = pPoints[i].m_PointX; FX_FLOAT y = pPoints[i].m_PointY; - int point_type = pPoints[i].m_Flag & FXPT_TYPE; - if (point_type == FXPT_MOVETO) { + FXPT_TYPE point_type = pPoints[i].m_Type; + if (point_type == FXPT_TYPE::MoveTo) { skPath.moveTo(x, y); - } else if (point_type == FXPT_LINETO) { + } else if (point_type == FXPT_TYPE::LineTo) { skPath.lineTo(x, y); - } else if (point_type == FXPT_BEZIERTO) { + } else if (point_type == FXPT_TYPE::BezierTo) { FX_FLOAT x2 = pPoints[i + 1].m_PointX, y2 = pPoints[i + 1].m_PointY; FX_FLOAT x3 = pPoints[i + 2].m_PointX, y3 = pPoints[i + 2].m_PointY; skPath.cubicTo(x, y, x2, y2, x3, y3); i += 2; } - if (pPoints[i].m_Flag & FXPT_CLOSEFIGURE) + if (pPoints[i].m_CloseFigure) skPath.close(); } return skPath; -- cgit v1.2.3