OLD | NEW |
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 // for std::max | 8 // for std::max |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 | 82 |
83 void do_curveMeasure(SkCanvas* canvas) { | 83 void do_curveMeasure(SkCanvas* canvas) { |
84 SkCurveMeasure meas(fPts, kQuad_SegType); | 84 SkCurveMeasure meas(fPts, kQuad_SegType); |
85 | 85 |
86 SkScalar totalLength = meas.getLength(); | 86 SkScalar totalLength = meas.getLength(); |
87 SkScalar pieceLength = totalLength / fPieces; | 87 SkScalar pieceLength = totalLength / fPieces; |
88 | 88 |
89 SkPoint point; | 89 SkPoint point; |
90 for (size_t i = 0; i <= fPieces; i++) { | 90 for (size_t i = 0; i <= fPieces; i++) { |
91 meas.getPosTan(i*pieceLength, &point, nullptr); | 91 meas.getPosTanTime(i*pieceLength, &point, nullptr, nullptr); |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 void onDraw(int loops, SkCanvas* canvas) override { | 95 void onDraw(int loops, SkCanvas* canvas) override { |
96 int inner_loops = numLoops(); | 96 int inner_loops = numLoops(); |
97 for (int i = 0; i < loops; i++) { | 97 for (int i = 0; i < loops; i++) { |
98 for (int j = 0; j < inner_loops; j++) { | 98 for (int j = 0; j < inner_loops; j++) { |
99 if (fUsePathMeasure) { | 99 if (fUsePathMeasure) { |
100 do_pathMeasure(canvas); | 100 do_pathMeasure(canvas); |
101 } | 101 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 DEF_BENCH(return new MeasureBench(false, 100, 100);) | 168 DEF_BENCH(return new MeasureBench(false, 100, 100);) |
169 DEF_BENCH(return new MeasureBench(false, 100, 200);) | 169 DEF_BENCH(return new MeasureBench(false, 100, 200);) |
170 DEF_BENCH(return new MeasureBench(false, 100, 300);) | 170 DEF_BENCH(return new MeasureBench(false, 100, 300);) |
171 DEF_BENCH(return new MeasureBench(false, 100, 400);) | 171 DEF_BENCH(return new MeasureBench(false, 100, 400);) |
172 DEF_BENCH(return new MeasureBench(false, 100, 500);) | 172 DEF_BENCH(return new MeasureBench(false, 100, 500);) |
173 DEF_BENCH(return new MeasureBench(false, 1000, 1000);) | 173 DEF_BENCH(return new MeasureBench(false, 1000, 1000);) |
174 DEF_BENCH(return new MeasureBench(false, 1000, 2000);) | 174 DEF_BENCH(return new MeasureBench(false, 1000, 2000);) |
175 DEF_BENCH(return new MeasureBench(false, 1000, 3000);) | 175 DEF_BENCH(return new MeasureBench(false, 1000, 3000);) |
176 DEF_BENCH(return new MeasureBench(false, 1000, 4000);) | 176 DEF_BENCH(return new MeasureBench(false, 1000, 4000);) |
177 DEF_BENCH(return new MeasureBench(false, 1000, 5000);) | 177 DEF_BENCH(return new MeasureBench(false, 1000, 5000);) |
OLD | NEW |