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

Unified Diff: src/pathops/SkPathOpsRect.h

Issue 1029993002: Revert of pathops version two (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « src/pathops/SkPathOpsQuadSect.h ('k') | src/pathops/SkPathOpsRect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/pathops/SkPathOpsQuadSect.h ('k') | src/pathops/SkPathOpsRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698