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

Unified Diff: src/pathops/SkLineParameters.h

Issue 15338003: path ops -- rewrite angle sort (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 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/SkIntersections.cpp ('k') | src/pathops/SkOpAngle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkLineParameters.h
===================================================================
--- src/pathops/SkLineParameters.h (revision 9425)
+++ src/pathops/SkLineParameters.h (working copy)
@@ -24,28 +24,37 @@
class SkLineParameters {
public:
void cubicEndPoints(const SkDCubic& pts) {
- cubicEndPoints(pts, 0, 3);
+ cubicEndPoints(pts, 0, 1);
+ if (dx() == 0 && dy() == 0) {
+ cubicEndPoints(pts, 0, 2);
+ if (dx() == 0 && dy() == 0) {
+ cubicEndPoints(pts, 0, 3);
+ }
+ }
}
void cubicEndPoints(const SkDCubic& pts, int s, int e) {
- a = approximately_pin(pts[s].fY - pts[e].fY);
- b = approximately_pin(pts[e].fX - pts[s].fX);
+ a = pts[s].fY - pts[e].fY;
+ b = pts[e].fX - pts[s].fX;
c = pts[s].fX * pts[e].fY - pts[e].fX * pts[s].fY;
}
void lineEndPoints(const SkDLine& pts) {
- a = approximately_pin(pts[0].fY - pts[1].fY);
- b = approximately_pin(pts[1].fX - pts[0].fX);
+ a = pts[0].fY - pts[1].fY;
+ b = pts[1].fX - pts[0].fX;
c = pts[0].fX * pts[1].fY - pts[1].fX * pts[0].fY;
}
void quadEndPoints(const SkDQuad& pts) {
- quadEndPoints(pts, 0, 2);
+ quadEndPoints(pts, 0, 1);
+ if (dx() == 0 && dy() == 0) {
+ quadEndPoints(pts, 0, 2);
+ }
}
void quadEndPoints(const SkDQuad& pts, int s, int e) {
- a = approximately_pin(pts[s].fY - pts[e].fY);
- b = approximately_pin(pts[e].fX - pts[s].fX);
+ a = pts[s].fY - pts[e].fY;
+ b = pts[e].fX - pts[s].fX;
c = pts[s].fX * pts[e].fY - pts[e].fX * pts[s].fY;
}
« no previous file with comments | « src/pathops/SkIntersections.cpp ('k') | src/pathops/SkOpAngle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698