diff options
author | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-11-19 13:06:06 +0000 |
---|---|---|
committer | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-11-19 13:06:06 +0000 |
commit | 56f233ab54d228f3ce05d0f7e15996424f9d5dd2 (patch) | |
tree | 7623a217ca8a88afe7f073c83933a87cdd07714d /include/core | |
parent | 15423544879e141e76ab8c0ab478d52a17a42e7b (diff) |
add two nested rect detector to path
Tease apart existing one rect path detector so
that a new variant can detect two nested rects as well.
Add tests to verify that both one and two rect
detectors both work and return the correct results.
Suppress other warnings in PathTest.
Review URL: https://codereview.appspot.com/6850059
git-svn-id: http://skia.googlecode.com/svn/trunk@6475 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkPath.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h index 20d041dd88..a162c1e07e 100644 --- a/include/core/SkPath.h +++ b/include/core/SkPath.h @@ -245,6 +245,16 @@ public: */ bool isRect(SkRect* rect) const; + /** Returns true if the path specifies a pair of nested rectangles. If so, and if + rect is not null, set rect[0] to the outer rectangle and rect[1] to the inner + rectangle. If the path does not specify a pair of nested rectangles, return + false and ignore rect. + + @param rect If not null, returns the path as a pair of nested rectangles + @return true if the path describes a pair of nested rectangles + */ + bool isNestedRects(SkRect rect[2]) const; + /** Return the number of points in the path */ int countPoints() const; @@ -906,6 +916,8 @@ private: inline bool hasOnlyMoveTos() const; Convexity internalGetConvexity() const; + + bool isRectContour(bool allowPartial, int* currVerb, const SkPoint** pts) const; friend class SkAutoPathBoundsUpdate; friend class SkAutoDisableOvalCheck; |