diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-13 18:01:05 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-13 18:01:05 +0000 |
commit | fa5edbe5750632b4590ed951c594dd2766ccc4cf (patch) | |
tree | ea35a8f03a39defbaf637828d87bd52cfbc4950f /include | |
parent | 9c28fa5579734129f1bad026b8b6aea3bf76da5f (diff) |
Add effect-based clip for nine-patch SkRRects.
BUG=skia:2181
R=jvanverth@google.com, robertphillips@google.com, rmistry@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/194703011
git-svn-id: http://skia.googlecode.com/svn/trunk@13794 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkRRect.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h index 9878b54fdc..c09d2d46fe 100644 --- a/include/core/SkRRect.h +++ b/include/core/SkRRect.h @@ -103,6 +103,17 @@ public: bool allCornersCircular() const; + /** + * Are both x-radii the same on the two left corners, and similar for the top, right, and + * bottom. When this is the case the four ellipse centers form a rectangle. + */ + bool isNinePatch() const { + return fRadii[kUpperLeft_Corner].fX == fRadii[kLowerLeft_Corner].fX && + fRadii[kUpperRight_Corner].fX == fRadii[kLowerRight_Corner].fX && + fRadii[kUpperLeft_Corner].fY == fRadii[kUpperRight_Corner].fY && + fRadii[kLowerLeft_Corner].fY == fRadii[kLowerRight_Corner].fY; + } + SkScalar width() const { return fRect.width(); } SkScalar height() const { return fRect.height(); } |