diff options
author | 2012-11-21 15:18:06 +0000 | |
---|---|---|
committer | 2012-11-21 15:18:06 +0000 | |
commit | f68154a3cf43eb22d45be11f3b09e25440c366a6 (patch) | |
tree | 0f13b66aac1503474f4ac0f0b7e5bb9146bc4ba5 /include/core/SkPath.h | |
parent | f276fa74f56d0c691716163d3149fce5de97c9ea (diff) |
Add isRect variant that returns path closure and direction.
Add path test to verify that when isRect() returns false,
output parameters are unchanged.
Review URL: https://codereview.appspot.com/6855074
git-svn-id: http://skia.googlecode.com/svn/trunk@6524 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkPath.h')
-rw-r--r-- | include/core/SkPath.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h index b2a034f2a4..cea964c177 100644 --- a/include/core/SkPath.h +++ b/include/core/SkPath.h @@ -535,6 +535,17 @@ public: return this->cheapComputeDirection(&computedDir) && computedDir == dir; } + /** Returns true if the path specifies a rectangle. If so, and if isClosed is + not null, set isClosed to true if the path is closed. Also, if returning true + and direction is not null, return the rect direction. If the path does not + specify a rectangle, return false and ignore isClosed and direction. + + @param isClosed If not null, set to true if the path is closed + @param direction If not null, set to the rectangle's direction + @return true if the path specifies a rectangle + */ + bool isRect(bool* isClosed, Direction* direction) const; + /** Add a closed rectangle contour to the path @param rect The rectangle to add as a closed contour to the path @param dir The direction to wind the rectangle's contour @@ -917,7 +928,8 @@ private: Convexity internalGetConvexity() const; - bool isRectContour(bool allowPartial, int* currVerb, const SkPoint** pts) const; + bool isRectContour(bool allowPartial, int* currVerb, const SkPoint** pts, + bool* isClosed, Direction* direction) const; friend class SkAutoPathBoundsUpdate; friend class SkAutoDisableOvalCheck; |