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

Unified Diff: src/pathops/SkPathOpsCurve.h

Issue 1096923003: working on initial winding for cubics (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkPathOpsCubic.cpp ('k') | src/pathops/SkPathOpsDebug.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsCurve.h
diff --git a/src/pathops/SkPathOpsCurve.h b/src/pathops/SkPathOpsCurve.h
index 5a2eeec37dff3e08ce210814606e252c40b3034d..69af91cf34622e2025b655a86429659cf3b5cbfc 100644
--- a/src/pathops/SkPathOpsCurve.h
+++ b/src/pathops/SkPathOpsCurve.h
@@ -26,6 +26,16 @@ struct SkOpCurve {
return fPts[n];
}
+ void dump() const;
+
+ void set(const SkDQuad& quad) {
+ for (int index = 0; index < SkDQuad::kPointCount; ++index) {
+ fPts[index] = quad[index].asSkPoint();
+ }
+ SkDEBUGCODE(fWeight = 1);
+ SkDEBUGCODE(fVerb = SkPath::kQuad_Verb);
+ }
+
void set(const SkDCubic& cubic) {
for (int index = 0; index < SkDCubic::kPointCount; ++index) {
fPts[index] = cubic[index].asSkPoint();
@@ -169,28 +179,29 @@ static SkVector (* const CurveSlopeAtT[])(const SkPoint[], SkScalar , double ) =
fcubic_dxdy_at_t
};
-static SkPoint quad_top(const SkPoint a[3], SkScalar , double startT, double endT) {
+static SkPoint quad_top(const SkPoint a[3], SkScalar , double startT, double endT, double* topT) {
SkDQuad quad;
quad.set(a);
- SkDPoint topPt = quad.top(startT, endT);
+ SkDPoint topPt = quad.top(startT, endT, topT);
return topPt.asSkPoint();
}
-static SkPoint conic_top(const SkPoint a[3], SkScalar weight, double startT, double endT) {
+static SkPoint conic_top(const SkPoint a[3], SkScalar weight, double startT, double endT,
+ double* topT) {
SkDConic conic;
conic.set(a, weight);
- SkDPoint topPt = conic.top(startT, endT);
+ SkDPoint topPt = conic.top(startT, endT, topT);
return topPt.asSkPoint();
}
-static SkPoint cubic_top(const SkPoint a[4], SkScalar , double startT, double endT) {
+static SkPoint cubic_top(const SkPoint a[4], SkScalar , double startT, double endT, double* topT) {
SkDCubic cubic;
cubic.set(a);
- SkDPoint topPt = cubic.top(startT, endT);
+ SkDPoint topPt = cubic.top(startT, endT, topT);
return topPt.asSkPoint();
}
-static SkPoint (* const CurveTop[])(const SkPoint[], SkScalar , double , double ) = {
+static SkPoint (* const CurveTop[])(const SkPoint[], SkScalar , double , double , double* ) = {
NULL,
NULL,
quad_top,
« no previous file with comments | « src/pathops/SkPathOpsCubic.cpp ('k') | src/pathops/SkPathOpsDebug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698