summaryrefslogtreecommitdiff
path: root/xfa/fxgraphics/cfx_path.h
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxgraphics/cfx_path.h')
-rw-r--r--xfa/fxgraphics/cfx_path.h78
1 files changed, 36 insertions, 42 deletions
diff --git a/xfa/fxgraphics/cfx_path.h b/xfa/fxgraphics/cfx_path.h
index 1dee566788..267831603a 100644
--- a/xfa/fxgraphics/cfx_path.h
+++ b/xfa/fxgraphics/cfx_path.h
@@ -7,58 +7,52 @@
#ifndef XFA_FXGRAPHICS_CFX_PATH_H_
#define XFA_FXGRAPHICS_CFX_PATH_H_
-#include <memory>
-
#include "core/fxcrt/fx_system.h"
+#include "core/fxge/cfx_pathdata.h"
#include "xfa/fxgraphics/cfx_graphics.h"
-class CFX_PathData;
-class CFX_PathGenerator;
-
class CFX_Path final {
public:
CFX_Path();
~CFX_Path();
- FWL_Error Create();
- FWL_Error MoveTo(const CFX_PointF& point);
- FWL_Error LineTo(const CFX_PointF& point);
- FWL_Error BezierTo(const CFX_PointF& c1,
- const CFX_PointF& c2,
- const CFX_PointF& to);
- FWL_Error ArcTo(const CFX_PointF& pos,
- const CFX_SizeF& size,
- FX_FLOAT startAngle,
- FX_FLOAT sweepAngle);
- FWL_Error Close();
-
- FWL_Error AddLine(const CFX_PointF& p1, const CFX_PointF& p2);
- FWL_Error AddBezier(const CFX_PointF& p1,
- const CFX_PointF& c1,
- const CFX_PointF& c2,
- const CFX_PointF& p2);
- FWL_Error AddRectangle(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height);
- FWL_Error AddEllipse(const CFX_PointF& pos, const CFX_SizeF& size);
- FWL_Error AddEllipse(const CFX_RectF& rect);
- FWL_Error AddArc(const CFX_PointF& pos,
- const CFX_SizeF& size,
- FX_FLOAT startAngle,
- FX_FLOAT sweepAngle);
- FWL_Error AddPie(const CFX_PointF& pos,
- const CFX_SizeF& size,
- FX_FLOAT startAngle,
- FX_FLOAT sweepAngle);
- FWL_Error AddSubpath(CFX_Path* path);
- FWL_Error Clear();
-
- bool IsEmpty() const;
- CFX_PathData* GetPathData() const;
+ const CFX_PathData* GetPathData() const { return &data_; }
+
+ void Clear();
+ bool IsEmpty() const { return data_.GetPoints().empty(); }
+ void TransformBy(const CFX_Matrix& mt);
+
+ void Close();
+ void MoveTo(const CFX_PointF& point);
+ void LineTo(const CFX_PointF& point);
+ void BezierTo(const CFX_PointF& c1,
+ const CFX_PointF& c2,
+ const CFX_PointF& to);
+ void ArcTo(const CFX_PointF& pos,
+ const CFX_SizeF& size,
+ FX_FLOAT startAngle,
+ FX_FLOAT sweepAngle);
+
+ void AddLine(const CFX_PointF& p1, const CFX_PointF& p2);
+ void AddRectangle(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height);
+ void AddEllipse(const CFX_RectF& rect);
+ void AddArc(const CFX_PointF& pos,
+ const CFX_SizeF& size,
+ FX_FLOAT startAngle,
+ FX_FLOAT sweepAngle);
+
+ void AddSubpath(CFX_Path* path);
private:
- std::unique_ptr<CFX_PathGenerator> m_generator;
+ void ArcToInternal(const CFX_PointF& pos,
+ const CFX_SizeF& size,
+ FX_FLOAT start_angle,
+ FX_FLOAT sweep_angle);
+
+ CFX_PathData data_;
};
#endif // XFA_FXGRAPHICS_CFX_PATH_H_