summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_pathdata.h
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 /core/fxge/cfx_pathdata.h
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 'core/fxge/cfx_pathdata.h')
-rw-r--r--core/fxge/cfx_pathdata.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/core/fxge/cfx_pathdata.h b/core/fxge/cfx_pathdata.h
index 3e0e11c4ee..46fdfeb740 100644
--- a/core/fxge/cfx_pathdata.h
+++ b/core/fxge/cfx_pathdata.h
@@ -12,9 +12,14 @@
#include "core/fxge/cfx_renderdevice.h"
struct FX_PATHPOINT {
+ bool IsTypeAndOpen(FXPT_TYPE type) const {
+ return m_Type == type && !m_CloseFigure;
+ }
+
FX_FLOAT m_PointX;
FX_FLOAT m_PointY;
- int m_Flag;
+ FXPT_TYPE m_Type;
+ bool m_CloseFigure;
};
class CFX_PathData {
@@ -24,7 +29,10 @@ class CFX_PathData {
~CFX_PathData();
int GetPointCount() const { return m_PointCount; }
- int GetFlag(int index) const { return m_pPoints[index].m_Flag; }
+ FXPT_TYPE GetType(int index) const { return m_pPoints[index].m_Type; }
+ bool IsClosingFigure(int index) const {
+ return m_pPoints[index].m_CloseFigure;
+ }
FX_FLOAT GetPointX(int index) const { return m_pPoints[index].m_PointX; }
FX_FLOAT GetPointY(int index) const { return m_pPoints[index].m_PointY; }
FX_PATHPOINT* GetPoints() const { return m_pPoints; }
@@ -43,7 +51,11 @@ class CFX_PathData {
bool IsRect(const CFX_Matrix* pMatrix, CFX_FloatRect* rect) const;
void Append(const CFX_PathData* pSrc, const CFX_Matrix* pMatrix);
void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top);
- void SetPoint(int index, FX_FLOAT x, FX_FLOAT y, int flag);
+ void SetPoint(int index,
+ FX_FLOAT x,
+ FX_FLOAT y,
+ FXPT_TYPE type,
+ bool closeFigure);
void TrimPoints(int nPoints);
void Copy(const CFX_PathData& src);