OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 paint.setAntiAlias(fFlags & kAA_Flag ? true : false); | 57 paint.setAntiAlias(fFlags & kAA_Flag ? true : false); |
58 | 58 |
59 SkPath path; | 59 SkPath path; |
60 this->makePath(&path); | 60 this->makePath(&path); |
61 if (fFlags & kBig_Flag) { | 61 if (fFlags & kBig_Flag) { |
62 const SkMatrix m = SkMatrix::MakeScale(SkIntToScalar(3), SkIntToScal
ar(3)); | 62 const SkMatrix m = SkMatrix::MakeScale(SkIntToScalar(3), SkIntToScal
ar(3)); |
63 path.transform(m); | 63 path.transform(m); |
64 } | 64 } |
65 | 65 |
66 for (int i = 0; i < loops; i++) { | 66 for (int i = 0; i < loops; i++) { |
67 canvas->drawPath(path, paint); | 67 for (int j = 0; j < 100; ++j) { |
| 68 canvas->drawPath(path, paint); |
| 69 } |
68 } | 70 } |
69 } | 71 } |
70 | 72 |
71 private: | 73 private: |
72 SkPaint fPaint; | 74 SkPaint fPaint; |
73 SkString fName; | 75 SkString fName; |
74 Flags fFlags; | 76 Flags fFlags; |
75 typedef Benchmark INHERITED; | 77 typedef Benchmark INHERITED; |
76 }; | 78 }; |
77 | 79 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // Don't have default path renderer for conics yet on GPU, so must use AA | 230 // Don't have default path renderer for conics yet on GPU, so must use AA |
229 // DEF_BENCH( return new ConicPathBench(FLAGS00); ) | 231 // DEF_BENCH( return new ConicPathBench(FLAGS00); ) |
230 // DEF_BENCH( return new ConicPathBench(FLAGS01); ) | 232 // DEF_BENCH( return new ConicPathBench(FLAGS01); ) |
231 DEF_BENCH( return new ConicPathBench(FLAGS10); ) | 233 DEF_BENCH( return new ConicPathBench(FLAGS10); ) |
232 DEF_BENCH( return new ConicPathBench(FLAGS11); ) | 234 DEF_BENCH( return new ConicPathBench(FLAGS11); ) |
233 | 235 |
234 DEF_BENCH( return new CubicPathBench(FLAGS00); ) | 236 DEF_BENCH( return new CubicPathBench(FLAGS00); ) |
235 DEF_BENCH( return new CubicPathBench(FLAGS01); ) | 237 DEF_BENCH( return new CubicPathBench(FLAGS01); ) |
236 DEF_BENCH( return new CubicPathBench(FLAGS10); ) | 238 DEF_BENCH( return new CubicPathBench(FLAGS10); ) |
237 DEF_BENCH( return new CubicPathBench(FLAGS11); ) | 239 DEF_BENCH( return new CubicPathBench(FLAGS11); ) |
OLD | NEW |