diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-29 19:54:52 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-29 19:54:52 +0000 |
commit | 744fabad474e3e111e7cbd8609cf7e209df17f32 (patch) | |
tree | d6248924804bf175d102ebe6c01306b8eec89e40 /include | |
parent | 4196c0e0e8f39a125dca5d7111449df34dfeadbe (diff) |
addPoly() entry-point, to quickly add MoveTo+N*LineTo (useful in dashing)
Review URL: https://codereview.appspot.com/6256063
git-svn-id: http://skia.googlecode.com/svn/trunk@4061 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkPath.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h index 03108dfd5b..e5093462f8 100644 --- a/include/core/SkPath.h +++ b/include/core/SkPath.h @@ -559,6 +559,19 @@ public: void addRoundRect(const SkRect& rect, const SkScalar radii[], Direction dir = kCW_Direction); + /** + * Add a new contour made of just lines. This is just a fast version of + * the following: + * this->moveTo(pts[0]); + * for (int i = 1; i < count; ++i) { + * this->lineTo(pts[i]); + * } + * if (close) { + * this->close(); + * } + */ + void addPoly(const SkPoint pts[], int count, bool close); + /** Add a copy of src to the path, offset by (dx,dy) @param src The path to add as a new contour @param dx The amount to translate the path in X as it is added |