aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-21 14:05:06 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-21 14:05:06 +0000
commitf0f617a502ae9298056654811542c62769a906c8 (patch)
treee271dc27ad1bb5795900467107cdd86c3289558d /include/core
parentcb6c2f4667666b349f5eeb4f4fff978f3212d406 (diff)
add SkRect::intersect(a, b), matching what was already available in SkIRect
git-svn-id: http://skia.googlecode.com/svn/trunk@2513 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkRect.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index 1399fbd6c0..76c99df648 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -485,6 +485,12 @@ struct SK_API SkRect {
fLeft < right && left < fRight &&
fTop < bottom && top < fBottom;
}
+
+ /** If rectangles a and b intersect, return true and set this rectangle to
+ * that intersection, otherwise return false and do not change this
+ * rectangle. If either rectangle is empty, do nothing and return false.
+ */
+ bool intersect(const SkRect& a, const SkRect& b);
/**
* Return true if rectangles a and b are not empty and intersect.