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

Unified Diff: src/pathops/SkPathOpsQuad.h

Issue 1037953004: add conics to path ops (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: turn off pathops specific debuggging 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/SkPathOpsPoint.h ('k') | src/pathops/SkPathOpsQuad.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsQuad.h
diff --git a/src/pathops/SkPathOpsQuad.h b/src/pathops/SkPathOpsQuad.h
index 81638cf0bc012c33d5a1b303680091fa410de25c..847c69cedde06f8d45d532d4dab89b6342ef5531 100644
--- a/src/pathops/SkPathOpsQuad.h
+++ b/src/pathops/SkPathOpsQuad.h
@@ -34,6 +34,10 @@ struct SkDQuad {
return v02.dot(v01) > 0 && v02.dot(v12) > 0;
}
+ void debugInit() {
+ sk_bzero(fPts, sizeof(fPts));
+ }
+
SkDQuad flip() const {
SkDQuad result = {{fPts[2], fPts[1], fPts[0]}};
return result;
@@ -41,10 +45,11 @@ struct SkDQuad {
static bool IsCubic() { return false; }
- void set(const SkPoint pts[kPointCount]) {
+ const SkDQuad& set(const SkPoint pts[kPointCount]) {
fPts[0] = pts[0];
fPts[1] = pts[1];
fPts[2] = pts[2];
+ return *this;
}
const SkDPoint& operator[](int n) const { SkASSERT(n >= 0 && n < kPointCount); return fPts[n]; }
@@ -56,6 +61,8 @@ struct SkDQuad {
SkDVector dxdyAtT(double t) const;
static int FindExtrema(double a, double b, double c, double tValue[1]);
bool hullIntersects(const SkDQuad& , bool* isLinear) const;
+ bool hullIntersects(const SkDConic& , bool* isLinear) const;
+ bool hullIntersects(const SkDCubic& , bool* isLinear) const;
bool isLinear(int startIndex, int endIndex) const;
bool monotonicInY() const;
double nearestT(const SkDPoint&) const;
@@ -77,6 +84,7 @@ struct SkDQuad {
quad.set(pts);
return quad.subDivide(a, c, t1, t2);
}
+ SkDConic toConic() const;
SkDCubic toCubic() const;
SkDPoint top(double startT, double endT) const;
« no previous file with comments | « src/pathops/SkPathOpsPoint.h ('k') | src/pathops/SkPathOpsQuad.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698