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

Unified Diff: src/utils/SkCurveMeasure.h

Issue 2233983003: Add better bounds checks for getTime to fix perf debug assert below (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | src/utils/SkCurveMeasure.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkCurveMeasure.h
diff --git a/src/utils/SkCurveMeasure.h b/src/utils/SkCurveMeasure.h
index 2846103633145729861e63d7b282fcc5ee67defe..5807211236efbe96d146eff421f096e5697e7957 100644
--- a/src/utils/SkCurveMeasure.h
+++ b/src/utils/SkCurveMeasure.h
@@ -44,6 +44,15 @@ private:
class SkCurveMeasure {
public:
SkCurveMeasure() {}
+
+ // Almost exactly the same as in SkPath::Iter:
+ // kLine_SegType -> 2 points: start end
+ // kQuad_SegType -> 3 points: start control end
+ // kCubic_SegType -> 4 points: start control1 control2 end
+ // kConic_SegType -> 4 points: start control end (w, w)
+ //
+ // i.e. the only difference is that the conic's last point is a point
+ // consisting of the w value twice
SkCurveMeasure(const SkPoint* pts, SkSegType segType);
SkScalar getTime(SkScalar targetLength);
@@ -51,13 +60,6 @@ public:
SkScalar getLength();
private:
- SkPoint evaluateQuad(SkScalar t);
- SkVector evaluateQuadDerivative(SkScalar t);
- //SkPoint evaluate_cubic(SkScalar t);
- //SkVector evaluate_cubic_derivative(SkScalar t);
- //SkPoint evaluate_conic(SkScalar t);
- //SkVector evaluate_conic_derivative(SkScalar t);
-
const SkScalar kTolerance = 0.0001f;
const int kNewtonIters = 5;
const int kBisectIters = 5;
« no previous file with comments | « no previous file | src/utils/SkCurveMeasure.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698