Index: src/pathops/SkPathOpsBounds.h |
diff --git a/src/pathops/SkPathOpsBounds.h b/src/pathops/SkPathOpsBounds.h |
index 61ef7bb874c07cef9202ac75fe016d85edc23cce..07ad5d4ba9d02221dafbd703e0b89fe334f0921c 100644 |
--- a/src/pathops/SkPathOpsBounds.h |
+++ b/src/pathops/SkPathOpsBounds.h |
@@ -13,8 +13,10 @@ |
// SkPathOpsBounds, unlike SkRect, does not consider a line to be empty. |
struct SkPathOpsBounds : public SkRect { |
static bool Intersects(const SkPathOpsBounds& a, const SkPathOpsBounds& b) { |
- return a.fLeft <= b.fRight && b.fLeft <= a.fRight && |
- a.fTop <= b.fBottom && b.fTop <= a.fBottom; |
+ return AlmostLessOrEqualUlps(a.fLeft, b.fRight) |
+ && AlmostLessOrEqualUlps(b.fLeft, a.fRight) |
+ && AlmostLessOrEqualUlps(a.fTop, b.fBottom) |
+ && AlmostLessOrEqualUlps(b.fTop, a.fBottom); |
} |
// Note that add(), unlike SkRect::join() or SkRect::growToInclude() |
@@ -38,6 +40,13 @@ struct SkPathOpsBounds : public SkRect { |
if (pt.fY > fBottom) fBottom = pt.fY; |
} |
+ bool almostContains(const SkPoint& pt) { |
+ return AlmostLessOrEqualUlps(fLeft, pt.fX) |
+ && AlmostLessOrEqualUlps(pt.fX, fRight) |
+ && AlmostLessOrEqualUlps(fTop, pt.fY) |
+ && AlmostLessOrEqualUlps(pt.fY, fBottom); |
+ } |
+ |
// unlike isEmpty(), this permits lines, but not points |
// FIXME: unused for now |
bool isReallyEmpty() const { |