summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_path.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-02-07 14:21:36 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-07 19:46:09 +0000
commit79365f7e3d2d62138e79e4403d4959318776c139 (patch)
treeb00196a8cdc6777ee0224653ef70bb2f2f7bb8b9 /xfa/fde/cfde_path.cpp
parentc222907f453e8a0e6376a86f89354eedb8285854 (diff)
downloadpdfium-79365f7e3d2d62138e79e4403d4959318776c139.tar.xz
Use enum class for PathPoint types.
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 <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_path.cpp')
-rw-r--r--xfa/fde/cfde_path.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/xfa/fde/cfde_path.cpp b/xfa/fde/cfde_path.cpp
index 6db0ccc6bf..cd65d9ee09 100644
--- a/xfa/fde/cfde_path.cpp
+++ b/xfa/fde/cfde_path.cpp
@@ -16,7 +16,7 @@ bool CFDE_Path::StartFigure() {
bool CFDE_Path::CloseFigure() {
FX_PATHPOINT* pPoint = GetLastPoint();
if (pPoint)
- pPoint->m_Flag |= FXPT_CLOSEFIGURE;
+ pPoint->m_CloseFigure = true;
return true;
}
@@ -32,7 +32,7 @@ FX_PATHPOINT* CFDE_Path::GetLastPoint(int32_t iCount) const {
bool CFDE_Path::FigureClosed() const {
FX_PATHPOINT* pPoint = GetLastPoint();
- return pPoint ? (pPoint->m_Flag & FXPT_CLOSEFIGURE) : true;
+ return pPoint ? pPoint->m_CloseFigure : true;
}
FX_PATHPOINT* CFDE_Path::AddPoints(int32_t iCount) {
@@ -48,14 +48,16 @@ void CFDE_Path::MoveTo(FX_FLOAT fx, FX_FLOAT fy) {
FX_PATHPOINT* pPoint = AddPoints(1);
pPoint->m_PointX = fx;
pPoint->m_PointY = fy;
- pPoint->m_Flag = FXPT_MOVETO;
+ pPoint->m_Type = FXPT_TYPE::MoveTo;
+ pPoint->m_CloseFigure = false;
}
void CFDE_Path::LineTo(FX_FLOAT fx, FX_FLOAT fy) {
FX_PATHPOINT* pPoint = AddPoints(1);
pPoint->m_PointX = fx;
pPoint->m_PointY = fy;
- pPoint->m_Flag = FXPT_LINETO;
+ pPoint->m_Type = FXPT_TYPE::LineTo;
+ pPoint->m_CloseFigure = false;
}
void CFDE_Path::BezierTo(const CFX_PointF& p1,
@@ -64,13 +66,16 @@ void CFDE_Path::BezierTo(const CFX_PointF& p1,
FX_PATHPOINT* p = AddPoints(3);
p[0].m_PointX = p1.x;
p[0].m_PointY = p1.y;
- p[0].m_Flag = FXPT_BEZIERTO;
+ p[0].m_Type = FXPT_TYPE::BezierTo;
+ p[0].m_CloseFigure = false;
p[1].m_PointX = p2.x;
p[1].m_PointY = p2.y;
- p[1].m_Flag = FXPT_BEZIERTO;
+ p[1].m_Type = FXPT_TYPE::BezierTo;
+ p[1].m_CloseFigure = false;
p[2].m_PointX = p3.x;
p[2].m_PointY = p3.y;
- p[2].m_Flag = FXPT_BEZIERTO;
+ p[2].m_Type = FXPT_TYPE::BezierTo;
+ p[2].m_CloseFigure = false;
}
void CFDE_Path::ArcTo(bool bStart,