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

Unified Diff: src/pathops/SkPathOpsBounds.h

Issue 1107353004: align top and bounds computations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up code Created 5 years, 8 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/SkOpSegment.cpp ('k') | src/pathops/SkPathOpsBounds.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsBounds.h
diff --git a/src/pathops/SkPathOpsBounds.h b/src/pathops/SkPathOpsBounds.h
index b65d3bea03e4f0ca85e640ef9e04bba1df7f6e9c..7b9daa3671d4c0fc36efe54134bf780beeaf3b5a 100644
--- a/src/pathops/SkPathOpsBounds.h
+++ b/src/pathops/SkPathOpsBounds.h
@@ -33,11 +33,11 @@ struct SkPathOpsBounds : public SkRect {
add(toAdd.fLeft, toAdd.fTop, toAdd.fRight, toAdd.fBottom);
}
- void add(const SkPoint& pt) {
- if (pt.fX < fLeft) fLeft = pt.fX;
- if (pt.fY < fTop) fTop = pt.fY;
- if (pt.fX > fRight) fRight = pt.fX;
- if (pt.fY > fBottom) fBottom = pt.fY;
+ void add(const SkDPoint& pt) {
+ if (pt.fX < fLeft) fLeft = SkDoubleToScalar(pt.fX);
+ if (pt.fY < fTop) fTop = SkDoubleToScalar(pt.fY);
+ if (pt.fX > fRight) fRight = SkDoubleToScalar(pt.fX);
+ if (pt.fY > fBottom) fBottom = SkDoubleToScalar(pt.fY);
}
bool almostContains(const SkPoint& pt) {
@@ -55,19 +55,12 @@ struct SkPathOpsBounds : public SkRect {
|| (fLeft == fRight && fTop == fBottom);
}
- void setConicBounds(const SkPoint a[3], SkScalar weight);
- void setCubicBounds(const SkPoint a[4], SkScalar );
- void setLineBounds(const SkPoint a[2], SkScalar );
- void setQuadBounds(const SkPoint a[3], SkScalar );
-
- void setPointBounds(const SkPoint& pt) {
- fLeft = fRight = pt.fX;
- fTop = fBottom = pt.fY;
+ void setPointBounds(const SkDPoint& pt) {
+ fLeft = fRight = SkDoubleToScalar(pt.fX);
+ fTop = fBottom = SkDoubleToScalar(pt.fY);
}
typedef SkRect INHERITED;
};
-extern void (SkPathOpsBounds::* const SetCurveBounds[])(const SkPoint[], SkScalar weight);
-
#endif
« no previous file with comments | « src/pathops/SkOpSegment.cpp ('k') | src/pathops/SkPathOpsBounds.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698