aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-13 21:51:38 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-13 21:51:38 +0000
commit9bee33afbeca29f531c8455513b925f6e93da633 (patch)
tree57653bf31451c1b661c639ca18168e56d7e3602b /include
parentfbb0ed959de64f16d236d2f0d81ddf5cb318e1fe (diff)
Add a conservativelyContainsRect function to SkPath.
Review URL: https://codereview.appspot.com/6852044 git-svn-id: http://skia.googlecode.com/svn/trunk@6411 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkPath.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index ee02c6546b..20d041dd88 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -292,7 +292,7 @@ public:
}
/** Calling this will, if the internal cache of the bounds is out of date,
- update it so that subsequent calls to getBounds will be instanteous.
+ update it so that subsequent calls to getBounds will be instantaneous.
This also means that any copies or simple transformations of the path
will inherit the cached bounds.
*/
@@ -301,6 +301,14 @@ public:
this->getBounds();
}
+ /**
+ * Does a conservative test to see whether a rectangle is inside a path. Currently it only
+ * will ever return true for single convex contour paths. The empty-status of the rect is not
+ * considered (e.g. a rect that is a point can be inside a path). Points or line segments where
+ * the rect edge touches the path border are not considered containment violations.
+ */
+ bool conservativelyContainsRect(const SkRect& rect) const;
+
// Construction methods
/** Hint to the path to prepare for adding more points. This can allow the