Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: include/core/SkRect.h

Issue 51953003: remove contains(x,y) for rects and rrects ... not well defined, and unused (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: include/core/SkRect.h
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index c615603d7e85b1d7adb645c20390a402f0c8f908..d9ac3a69109fdb6efc2d464104440d8b5caf4370 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;
« no previous file with comments | « include/core/SkRRect.h ('k') | src/core/SkPath.cpp » ('j') | src/core/SkPath.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698