Index: src/pathops/SkPathOpsRect.h |
diff --git a/src/pathops/SkPathOpsRect.h b/src/pathops/SkPathOpsRect.h |
index 2b37a5f0980a4fd3c26ae8292844a720ce2cbe09..2c47f43b88798d995c2258774105e9cc2afad538 100644 |
--- a/src/pathops/SkPathOpsRect.h |
+++ b/src/pathops/SkPathOpsRect.h |
@@ -13,10 +13,18 @@ |
double fLeft, fTop, fRight, fBottom; |
void add(const SkDPoint& pt) { |
- fLeft = SkTMin(fLeft, pt.fX); |
- fTop = SkTMin(fTop, pt.fY); |
- fRight = SkTMax(fRight, pt.fX); |
- fBottom = SkTMax(fBottom, pt.fY); |
+ if (fLeft > pt.fX) { |
+ fLeft = pt.fX; |
+ } |
+ if (fTop > pt.fY) { |
+ fTop = pt.fY; |
+ } |
+ if (fRight < pt.fX) { |
+ fRight = pt.fX; |
+ } |
+ if (fBottom < pt.fY) { |
+ fBottom = pt.fY; |
+ } |
} |
bool contains(const SkDPoint& pt) const { |
@@ -24,15 +32,12 @@ |
&& approximately_between(fTop, pt.fY, fBottom); |
} |
- bool intersects(const SkDRect& r) const { |
- if (fLeft > fRight) { |
- SkDebugf("!"); |
- } |
+ bool intersects(SkDRect* r) const { |
SkASSERT(fLeft <= fRight); |
SkASSERT(fTop <= fBottom); |
- SkASSERT(r.fLeft <= r.fRight); |
- SkASSERT(r.fTop <= r.fBottom); |
- return r.fLeft <= fRight && fLeft <= r.fRight && r.fTop <= fBottom && fTop <= r.fBottom; |
+ SkASSERT(r->fLeft <= r->fRight); |
+ SkASSERT(r->fTop <= r->fBottom); |
+ return r->fLeft <= fRight && fLeft <= r->fRight && r->fTop <= fBottom && fTop <= r->fBottom; |
} |
void set(const SkDPoint& pt) { |
@@ -48,8 +53,11 @@ |
return fBottom - fTop; |
} |
+ void setBounds(const SkDLine&); |
void setBounds(const SkDCubic&); |
void setBounds(const SkDQuad&); |
+ void setRawBounds(const SkDCubic&); |
+ void setRawBounds(const SkDQuad&); |
}; |
#endif |