| Index: include/core/SkRRect.h
|
| ===================================================================
|
| --- include/core/SkRRect.h (revision 8834)
|
| +++ include/core/SkRRect.h (working copy)
|
| @@ -200,27 +200,33 @@
|
|
|
| /**
|
| * Returns true if (p.fX,p.fY) is inside the RR, and the RR
|
| - * is not empty.
|
| + * is not empty. The 'loose' parameter controls the containment
|
| + * policly on the right and bottom edges (loose -> "<="; !loose ->
|
| + * "<"). It should be set to true when the point should be considered
|
| + * "in" when it lies on a R/B edge (e.g., the right edge of an SkRect).
|
| *
|
| * 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);
|
| + bool contains(const SkPoint& p, bool loose = false) const {
|
| + return contains(p.fX, p.fY, loose);
|
| }
|
|
|
| /**
|
| * Returns true if (x,y) is inside the RR, and the RR
|
| - * is not empty.
|
| + * is not empty. The 'loose' parameter controls the containment
|
| + * policly on the right and bottom edges (loose -> "<="; !loose ->
|
| + * "<"). It should be set to true when the point should be considered
|
| + * "in" when it lies on a R/B edge (e.g., the right edge of an SkRect).
|
| *
|
| * 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;
|
| + bool contains(SkScalar x, SkScalar y, bool loose = false) const;
|
|
|
| /**
|
| * Call inset on the bounds, and adjust the radii to reflect what happens
|
| @@ -251,6 +257,17 @@
|
| this->inset(-dx, -dy, this);
|
| }
|
|
|
| + /**
|
| + * Returns true if 'rect' is wholy inside the RR, and both
|
| + * are 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 SkRect& rect) const;
|
| +
|
| SkDEBUGCODE(void validate() const;)
|
|
|
| enum {
|
|
|