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