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

Side by Side Diff: bench/MeasureBench.cpp

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 | « no previous file | src/utils/SkCurveMeasure.h » ('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 // 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
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
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);)
OLDNEW
« no previous file with comments | « no previous file | src/utils/SkCurveMeasure.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698