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

Side by Side Diff: src/utils/SkCurveMeasure.h

Issue 2229893002: Add time return argument to SkCurveMeasure's getPosTan, rename to getPosTanTime (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 unified diff | Download patch
« no previous file with comments | « bench/MeasureBench.cpp ('k') | src/utils/SkCurveMeasure.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkCurveMeasure_DEFINED 8 #ifndef SkCurveMeasure_DEFINED
9 #define SkCurveMeasure_DEFINED 9 #define SkCurveMeasure_DEFINED
10 10
(...skipping 29 matching lines...) Expand all
40 Sk8f xCoeff[3]; 40 Sk8f xCoeff[3];
41 Sk8f yCoeff[3]; 41 Sk8f yCoeff[3];
42 }; 42 };
43 43
44 class SkCurveMeasure { 44 class SkCurveMeasure {
45 public: 45 public:
46 SkCurveMeasure() {} 46 SkCurveMeasure() {}
47 SkCurveMeasure(const SkPoint* pts, SkSegType segType); 47 SkCurveMeasure(const SkPoint* pts, SkSegType segType);
48 48
49 SkScalar getTime(SkScalar targetLength); 49 SkScalar getTime(SkScalar targetLength);
50 void getPosTan(SkScalar distance, SkPoint* pos, SkVector* tan); 50 void getPosTanTime(SkScalar distance, SkPoint* pos, SkVector* tan, SkScalar* time);
51 SkScalar getLength(); 51 SkScalar getLength();
52 52
53 private: 53 private:
54 SkPoint evaluateQuad(SkScalar t); 54 SkPoint evaluateQuad(SkScalar t);
55 SkVector evaluateQuadDerivative(SkScalar t); 55 SkVector evaluateQuadDerivative(SkScalar t);
56 //SkPoint evaluate_cubic(SkScalar t); 56 //SkPoint evaluate_cubic(SkScalar t);
57 //SkVector evaluate_cubic_derivative(SkScalar t); 57 //SkVector evaluate_cubic_derivative(SkScalar t);
58 //SkPoint evaluate_conic(SkScalar t); 58 //SkPoint evaluate_conic(SkScalar t);
59 //SkVector evaluate_conic_derivative(SkScalar t); 59 //SkVector evaluate_conic_derivative(SkScalar t);
60 60
61 const SkScalar kTolerance = 0.0001f; 61 const SkScalar kTolerance = 0.0001f;
62 const int kNewtonIters = 5; 62 const int kNewtonIters = 5;
63 const int kBisectIters = 5; 63 const int kBisectIters = 5;
64 64
65 SkSegType fSegType; 65 SkSegType fSegType;
66 SkPoint fPts[4]; 66 SkPoint fPts[4];
67 SkScalar fLength = -1.0f; 67 SkScalar fLength = -1.0f;
68 ArcLengthIntegrator fIntegrator; 68 ArcLengthIntegrator fIntegrator;
69 69
70 // for debug purposes 70 // for debug purposes
71 int fIters; 71 int fIters;
72 }; 72 };
73 73
74 #endif // SkCurveMeasure_DEFINED 74 #endif // SkCurveMeasure_DEFINED
OLDNEW
« no previous file with comments | « bench/MeasureBench.cpp ('k') | src/utils/SkCurveMeasure.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698