aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-11 21:16:29 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-11 21:16:29 +0000
commit14747e58f8127a6d6b3c748bf0642b0d6a3a79e8 (patch)
tree26e515b09e3f3537a653956fe772fe1f6c65f4b9 /include/core
parente07dfe54c4b7b1c5fd1a4ba2e161903484bfac3a (diff)
Adding new 'extend' mode to SkPath::addPath
BUG=261727 R=reed@google.com, caryclark@google.com, schenney@chromium.org, robertphillips@google.com Author: junov@chromium.org Review URL: https://codereview.chromium.org/151353006 git-svn-id: http://skia.googlecode.com/svn/trunk@13415 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkPath.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index 5e31e2813c..ca30018306 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -702,25 +702,41 @@ public:
*/
void addPoly(const SkPoint pts[], int count, bool close);
+ enum AddPathMode {
+ /** Source path contours are added as new contours.
+ */
+ kAppend_AddPathMode,
+ /** Path is added by extending the last contour of the destination path
+ with the first contour of the source path. If the last contour of
+ the destination path is closed, then it will not be extended.
+ Instead, the start of source path will be extended by a straight
+ line to the end point of the destination path.
+ */
+ kExtend_AddPathMode
+ };
+
/** 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
@param dx The amount to translate the path in Y as it is added
*/
- void addPath(const SkPath& src, SkScalar dx, SkScalar dy);
+ void addPath(const SkPath& src, SkScalar dx, SkScalar dy,
+ AddPathMode mode = kAppend_AddPathMode);
/** Add a copy of src to the path
*/
- void addPath(const SkPath& src) {
+ void addPath(const SkPath& src, AddPathMode mode = kAppend_AddPathMode) {
SkMatrix m;
m.reset();
- this->addPath(src, m);
+ this->addPath(src, m, mode);
}
/** Add a copy of src to the path, transformed by matrix
@param src The path to add as a new contour
+ @param matrix Transform applied to src
+ @param mode Determines how path is added
*/
- void addPath(const SkPath& src, const SkMatrix& matrix);
+ void addPath(const SkPath& src, const SkMatrix& matrix, AddPathMode mode = kAppend_AddPathMode);
/**
* Same as addPath(), but reverses the src input