diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-30 17:39:43 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-30 17:39:43 +0000 |
commit | 4db592c4085afed2be27a208d778f9ee13e671ab (patch) | |
tree | 552cc422fc26f9e5db0386410ecf2fded67c0227 /include | |
parent | 4e5559af8947ae7dc3df531b6d7a73323db20c3f (diff) |
remove contains(x,y) for rects and rrects ... not well defined, and unused
BUG=
R=robertphillips@google.com
Review URL: https://codereview.chromium.org/51953003
git-svn-id: http://skia.googlecode.com/svn/trunk@12022 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkRRect.h | 24 | ||||
-rw-r--r-- | include/core/SkRect.h | 29 |
2 files changed, 1 insertions, 52 deletions
diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h index 32d62856bc..402e6c6c4b 100644 --- a/include/core/SkRRect.h +++ b/include/core/SkRRect.h @@ -199,30 +199,6 @@ public: } /** - * Returns true if (p.fX,p.fY) is inside the RR, and the RR - * is not empty. - * - * Contains treats the left and top differently from the right and bottom. - * The left and top coordinates of the RR are themselves considered - * to be inside, while the right and bottom are not. All the points on the - * edges of the corners are considered to be inside. - */ - bool contains(const SkPoint& p) const { - return contains(p.fX, p.fY); - } - - /** - * Returns true if (x,y) is inside the RR, and the RR - * is not empty. - * - * Contains treats the left and top differently from the right and bottom. - * The left and top coordinates of the RR are themselves considered - * to be inside, while the right and bottom are not. All the points on the - * edges of the corners are considered to be inside. - */ - bool contains(SkScalar x, SkScalar y) const; - - /** * 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 diff --git a/include/core/SkRect.h b/include/core/SkRect.h index c615603d7e..d9ac3a6910 100644 --- a/include/core/SkRect.h +++ b/include/core/SkRect.h @@ -718,38 +718,11 @@ struct SK_API SkRect { } /** - * Returns true if (p.fX,p.fY) is inside the rectangle, and the rectangle - * is not empty. - * - * Contains treats the left and top differently from the right and bottom. - * The left and top coordinates of the rectangle are themselves considered - * to be inside, while the right and bottom are not. Thus for the rectangle - * {0, 0, 5, 10}, (0,0) is contained, but (0,10), (5,0) and (5,10) are not. - */ - bool contains(const SkPoint& p) const { - return !this->isEmpty() && - fLeft <= p.fX && p.fX < fRight && fTop <= p.fY && p.fY < fBottom; - } - - /** - * Returns true if (x,y) is inside the rectangle, and the rectangle - * is not empty. - * - * Contains treats the left and top differently from the right and bottom. - * The left and top coordinates of the rectangle are themselves considered - * to be inside, while the right and bottom are not. Thus for the rectangle - * {0, 0, 5, 10}, (0,0) is contained, but (0,10), (5,0) and (5,10) are not. - */ - bool contains(SkScalar x, SkScalar y) const { - return !this->isEmpty() && - fLeft <= x && x < fRight && fTop <= y && y < fBottom; - } - - /** * Return true if this rectangle contains r, and if both rectangles are * not empty. */ bool contains(const SkRect& r) const { + // todo: can we eliminate the this->isEmpty check? return !r.isEmpty() && !this->isEmpty() && fLeft <= r.fLeft && fTop <= r.fTop && fRight >= r.fRight && fBottom >= r.fBottom; |