summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_path.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-15 11:07:32 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-15 17:47:57 +0000
commite4602321f3175fa5addb6761d0e94f5c2fc93d0c (patch)
tree6671774659645fad6d9ce55a5910b4665a25094f /core/fpdfapi/page/cpdf_path.cpp
parenteb55885e9a9eec670ed98cbd12dc96d63e6a6623 (diff)
downloadpdfium-e4602321f3175fa5addb6761d0e94f5c2fc93d0c.tar.xz
Cleanup CFX_PathData.
This CL replaces the array of path points with a vector. Cleaning up the usage as required. Change-Id: Ifa386a2c847005fef68af748ebe99c4e08961238 Reviewed-on: https://pdfium-review.googlesource.com/2710 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_path.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_path.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/core/fpdfapi/page/cpdf_path.cpp b/core/fpdfapi/page/cpdf_path.cpp
index 96d6b72abb..a95ce1e5bc 100644
--- a/core/fpdfapi/page/cpdf_path.cpp
+++ b/core/fpdfapi/page/cpdf_path.cpp
@@ -12,20 +12,12 @@ CPDF_Path::CPDF_Path(const CPDF_Path& that) : m_Ref(that.m_Ref) {}
CPDF_Path::~CPDF_Path() {}
-int CPDF_Path::GetPointCount() const {
- return m_Ref.GetObject()->GetPointCount();
-}
-
-void CPDF_Path::SetPointCount(int count) {
- m_Ref.GetPrivateCopy()->SetPointCount(count);
-}
-
-const FX_PATHPOINT* CPDF_Path::GetPoints() const {
+const std::vector<FX_PATHPOINT>& CPDF_Path::GetPoints() const {
return m_Ref.GetObject()->GetPoints();
}
-FX_PATHPOINT* CPDF_Path::GetMutablePoints() {
- return m_Ref.GetPrivateCopy()->GetPoints();
+void CPDF_Path::ClosePath() {
+ m_Ref.GetPrivateCopy()->ClosePath();
}
FX_FLOAT CPDF_Path::GetPointX(int index) const {
@@ -73,7 +65,6 @@ void CPDF_Path::AppendPoint(FX_FLOAT x,
FXPT_TYPE type,
bool close) {
CFX_PathData data;
- data.SetPointCount(1);
- data.SetPoint(0, x, y, type, close);
+ data.AppendPoint(x, y, type, close);
Append(&data, nullptr);
}