aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkRRect.h
diff options
context:
space:
mode:
authorGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-23 23:11:21 +0000
committerGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-23 23:11:21 +0000
commitbcbef579d02e255b9a29b5db2d6804f4bfc76d1c (patch)
treeffad137edc5dda0c6a6a18d59bd387530a8b8f68 /include/core/SkRRect.h
parent15ed90f6ee939055ce6e2e1ace0292e7c3d9cbfc (diff)
add SkRRect::inset(), which mimics stroking
git-svn-id: http://skia.googlecode.com/svn/trunk@6935 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkRRect.h')
-rw-r--r--include/core/SkRRect.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h
index b09d27ac20..d6187f415a 100644
--- a/include/core/SkRRect.h
+++ b/include/core/SkRRect.h
@@ -220,18 +220,34 @@ public:
*/
bool contains(SkScalar x, SkScalar y) const;
-#if 0
+ /**
+ * Call inset on the bounds, and adjust the radii to reflect what happens
+ * in stroking: If the corner is sharp (no curvature), leave it alone,
+ * otherwise we grow/shrink the radii by the amount of the inset. If a
+ * given radius becomes negative, it is pinned to 0.
+ *
+ * It is valid for dst == this.
+ */
void inset(SkScalar dx, SkScalar dy, SkRRect* dst) const;
+
void inset(SkScalar dx, SkScalar dy) {
this->inset(dx, dy, this);
}
+
+ /**
+ * Call outset on the bounds, and adjust the radii to reflect what happens
+ * in stroking: If the corner is sharp (no curvature), leave it alone,
+ * otherwise we grow/shrink the radii by the amount of the inset. If a
+ * given radius becomes negative, it is pinned to 0.
+ *
+ * It is valid for dst == this.
+ */
void outset(SkScalar dx, SkScalar dy, SkRRect* dst) const {
this->inset(-dx, -dy, dst);
}
void outset(SkScalar dx, SkScalar dy) {
this->inset(-dx, -dy, this);
}
-#endif
SkDEBUGCODE(void validate() const;)