summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-21 21:46:56 +0200
committerChromium commit bot <commit-bot@chromium.org>2017-09-22 13:47:46 +0000
commit0150a5455829ede62017bc24ed9c4bcdc1cafef2 (patch)
tree27e595f415590d75af16bdcb6531c05cd6b01d93
parent09b5ce623fc47bc3d19d60aa2a219c838971dd4b (diff)
downloadpdfium-0150a5455829ede62017bc24ed9c4bcdc1cafef2.tar.xz
API: rename FPDFPath_CountPoint() to FPDFPath_CountSegments()
This was the last place talking about "point objects". Change-Id: Ib5f5d5b8efdd674ca5902ff82c2bd4d9f2db8bb1 Reviewed-on: https://pdfium-review.googlesource.com/14651 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
-rw-r--r--fpdfsdk/fpdfedit_embeddertest.cpp8
-rw-r--r--fpdfsdk/fpdfeditpath.cpp2
-rw-r--r--fpdfsdk/fpdfview_c_api_test.c2
-rw-r--r--public/fpdf_edit.h8
4 files changed, 10 insertions, 10 deletions
diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp
index 6826317ef2..f8c053a6ad 100644
--- a/fpdfsdk/fpdfedit_embeddertest.cpp
+++ b/fpdfsdk/fpdfedit_embeddertest.cpp
@@ -258,7 +258,7 @@ TEST_F(FPDFEditEmbeddertest, AddPaths) {
// Make sure the path has 5 points (1 FXPT_TYPE::MoveTo and 4
// FXPT_TYPE::LineTo).
- ASSERT_EQ(5, FPDFPath_CountPoint(green_rect));
+ ASSERT_EQ(5, FPDFPath_CountSegments(green_rect));
// Verify actual coordinates.
FPDF_PATHSEGMENT segment = FPDFPath_GetPathSegment(green_rect, 0);
float x;
@@ -309,7 +309,7 @@ TEST_F(FPDFEditEmbeddertest, AddPaths) {
// Make sure the path has 3 points (1 FXPT_TYPE::MoveTo and 2
// FXPT_TYPE::LineTo).
- ASSERT_EQ(3, FPDFPath_CountPoint(black_path));
+ ASSERT_EQ(3, FPDFPath_CountSegments(black_path));
// Verify actual coordinates.
segment = FPDFPath_GetPathSegment(black_path, 0);
EXPECT_TRUE(FPDFPathSegment_GetPoint(segment, &x, &y));
@@ -366,10 +366,10 @@ TEST_F(FPDFEditEmbeddertest, PathsPoints) {
CreateNewDocument();
FPDF_PAGEOBJECT img = FPDFPageObj_NewImageObj(document_);
// This should fail gracefully, even if img is not a path.
- ASSERT_EQ(-1, FPDFPath_CountPoint(img));
+ ASSERT_EQ(-1, FPDFPath_CountSegments(img));
// This should fail gracefully, even if path is NULL.
- ASSERT_EQ(-1, FPDFPath_CountPoint(nullptr));
+ ASSERT_EQ(-1, FPDFPath_CountSegments(nullptr));
// FPDFPath_GetPathSegment() with a non-path.
ASSERT_EQ(nullptr, FPDFPath_GetPathSegment(img, 0));
diff --git a/fpdfsdk/fpdfeditpath.cpp b/fpdfsdk/fpdfeditpath.cpp
index a91dfdb421..30c6cb0698 100644
--- a/fpdfsdk/fpdfeditpath.cpp
+++ b/fpdfsdk/fpdfeditpath.cpp
@@ -127,7 +127,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetFillColor(FPDF_PAGEOBJECT path,
return true;
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFPath_CountPoint(FPDF_PAGEOBJECT path) {
+FPDF_EXPORT int FPDF_CALLCONV FPDFPath_CountSegments(FPDF_PAGEOBJECT path) {
auto* pPathObj = CPDFPathObjectFromFPDFPageObject(path);
if (!pPathObj)
return -1;
diff --git a/fpdfsdk/fpdfview_c_api_test.c b/fpdfsdk/fpdfview_c_api_test.c
index b3fe303eac..cc5d6c995d 100644
--- a/fpdfsdk/fpdfview_c_api_test.c
+++ b/fpdfsdk/fpdfview_c_api_test.c
@@ -148,7 +148,7 @@ int CheckPDFiumCApi() {
CHK(FPDFPath_SetStrokeWidth);
CHK(FPDFPath_SetFillColor);
CHK(FPDFPath_GetFillColor);
- CHK(FPDFPath_CountPoint);
+ CHK(FPDFPath_CountSegments);
CHK(FPDFPath_GetPathSegment);
CHK(FPDFPathSegment_GetPoint);
CHK(FPDFPathSegment_GetType);
diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h
index d73a740efd..6e4f9a4ae8 100644
--- a/public/fpdf_edit.h
+++ b/public/fpdf_edit.h
@@ -559,15 +559,15 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetFillColor(FPDF_PAGEOBJECT path,
unsigned int* A);
// Experimental API.
-// Get number of point objects inside |path|.
+// Get number of segments inside |path|.
//
// path - handle to a path.
//
-// A point object is a command, created by e.g. FPDFPath_MoveTo() or
-// FPDFPath_LineTo().
+// A segment is a command, created by e.g. FPDFPath_MoveTo(),
+// FPDFPath_LineTo() or FPDFPath_BezierTo().
//
// Returns the number of objects in |path| or -1 on failure.
-FPDF_EXPORT int FPDF_CALLCONV FPDFPath_CountPoint(FPDF_PAGEOBJECT path);
+FPDF_EXPORT int FPDF_CALLCONV FPDFPath_CountSegments(FPDF_PAGEOBJECT path);
// Experimental API.
// Get segment in |path| at |index|.