summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_path.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-02-07 14:59:23 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-07 20:47:07 +0000
commit55e026b7b6eec17b012c819c4a7d39e63094b5c4 (patch)
tree5dfdf3759f9d13a87dab2bfd354aaa6342728716 /core/fpdfapi/page/cpdf_path.cpp
parent79365f7e3d2d62138e79e4403d4959318776c139 (diff)
downloadpdfium-55e026b7b6eec17b012c819c4a7d39e63094b5c4.tar.xz
Add APIs for path construction and paintingchromium/3006
Added methods to create paths, set their colors, determine whether they will be stroked and/or filled. FPDFPage_InsertObject should be used to add a path to a page. BUG=pdfium:661 Change-Id: I8fd17b33a09c5126e517bfd1a69a893216c160e8 Reviewed-on: https://pdfium-review.googlesource.com/2534 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_path.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_path.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_path.cpp b/core/fpdfapi/page/cpdf_path.cpp
index 8151ae46d7..96d6b72abb 100644
--- a/core/fpdfapi/page/cpdf_path.cpp
+++ b/core/fpdfapi/page/cpdf_path.cpp
@@ -67,3 +67,13 @@ void CPDF_Path::AppendRect(FX_FLOAT left,
FX_FLOAT top) {
m_Ref.GetPrivateCopy()->AppendRect(left, bottom, right, top);
}
+
+void CPDF_Path::AppendPoint(FX_FLOAT x,
+ FX_FLOAT y,
+ FXPT_TYPE type,
+ bool close) {
+ CFX_PathData data;
+ data.SetPointCount(1);
+ data.SetPoint(0, x, y, type, close);
+ Append(&data, nullptr);
+}