From 37071640f6bdcb1bfb193f85b9ca615b29679425 Mon Sep 17 00:00:00 2001 From: "mike@reedtribe.org" Date: Mon, 17 Dec 2012 02:10:42 +0000 Subject: add gm for rrect, and rrect.inset/outset git-svn-id: http://skia.googlecode.com/svn/trunk@6832 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkRRect.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h index eb2a770f62..ac2b7a2810 100644 --- a/include/core/SkRRect.h +++ b/include/core/SkRRect.h @@ -103,6 +103,9 @@ public: inline bool isSimple() const { return kSimple_Type == this->getType(); } inline bool isComplex() const { return kComplex_Type == this->getType(); } + SkScalar width() const { return fRect.width(); } + SkScalar height() const { return fRect.height(); } + /** * Set this RR to the empty rectangle (0,0,0,0) with 0 x & y radii. */ @@ -217,6 +220,17 @@ public: */ bool contains(SkScalar x, SkScalar y) const; + void inset(SkScalar dx, SkScalar dy, SkRRect* dst) const; + void inset(SkScalar dx, SkScalar dy) { + this->inset(dx, dy, 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); + } + SkDEBUGCODE(void validate() const;) enum { -- cgit v1.2.3