diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-17 19:47:40 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-17 19:47:40 +0000 |
commit | bab3fc4c90c4369c5d77d8da86d9f117ee54e0bc (patch) | |
tree | 12a8a698fcc7e3c7136a367a0fd4972cdad74562 /include/core/SkRRect.h | |
parent | ecb745dba75dde72e5edde72e4b309120e66033b (diff) |
Revert of Add nine patch type to SkRRect. (https://codereview.chromium.org/196343015/)
Reason for revert:
causes tests to have infinite loop
Original issue's description:
> Add nine patch type to SkRRect.
>
> BUG=skia:2181
>
> Committed: http://code.google.com/p/skia/source/detail?r=13833
R=robertphillips@google.com, reed@google.com
TBR=reed@google.com, robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2181
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/202163004
git-svn-id: http://skia.googlecode.com/svn/trunk@13837 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkRRect.h')
-rw-r--r-- | include/core/SkRRect.h | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h index 5223ae7072..c09d2d46fe 100644 --- a/include/core/SkRRect.h +++ b/include/core/SkRRect.h @@ -71,14 +71,6 @@ public: //!< the curves) nor a rect (i.e., both radii are non-zero) kSimple_Type, - //!< The RR is non-empty and the two left x radii are equal, the two top - //!< y radii are equal, and the same for the right and bottom but it is - //!< neither an rect, oval, nor a simple RR. It is called "nine patch" - //!< because the centers of the corner ellipses form an axis aligned - //!< rect with edges that divide the RR into an 9 rectangular patches: - //!< an interior patch, four edge patches, and four corner patches. - kNinePatch_Type, - //!< A fully general (non-empty) RR. Some of the x and/or y radii are //!< different from the others and there must be one corner where //!< both radii are non-zero. @@ -107,11 +99,21 @@ public: inline bool isSimpleCircular() const { return this->isSimple() && fRadii[0].fX == fRadii[0].fY; } - inline bool isNinePatch() const { return kNinePatch_Type == this->getType(); } inline bool isComplex() const { return kComplex_Type == this->getType(); } 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(); } @@ -170,12 +172,6 @@ public: void setRectXY(const SkRect& rect, SkScalar xRad, SkScalar yRad); /** - * Initialize the rr with one radius per-side. - */ - void setNinePatch(const SkRect& rect, SkScalar leftRad, SkScalar topRad, - SkScalar rightRad, SkScalar bottomRad); - - /** * Initialize the RR with potentially different radii for all four corners. */ void setRectRadii(const SkRect& rect, const SkVector radii[4]); |