OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkPaint.h" | 9 #include "SkPaint.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 const char* onGetName() override { return fName.c_str(); } | 28 const char* onGetName() override { return fName.c_str(); } |
29 | 29 |
30 void onDraw(const int loops, SkCanvas* canvas) override { | 30 void onDraw(const int loops, SkCanvas* canvas) override { |
31 SkPaint paint(fPaint); | 31 SkPaint paint(fPaint); |
32 this->setupPaint(&paint); | 32 this->setupPaint(&paint); |
33 | 33 |
34 for (int outer = 0; outer < 10; ++outer) { | 34 for (int outer = 0; outer < 10; ++outer) { |
35 for (int i = 0; i < loops; ++i) { | 35 for (int i = 0; i < loops; ++i) { |
36 SkPath result; | 36 SkPath result; |
37 paint.getFillPath(fPath, &result, NULL, fRes); | 37 paint.getFillPath(fPath, &result, nullptr, fRes); |
38 } | 38 } |
39 } | 39 } |
40 } | 40 } |
41 | 41 |
42 private: | 42 private: |
43 SkPath fPath; | 43 SkPath fPath; |
44 SkPaint fPaint; | 44 SkPaint fPaint; |
45 SkString fName; | 45 SkString fName; |
46 SkScalar fRes; | 46 SkScalar fRes; |
47 typedef Benchmark INHERITED; | 47 typedef Benchmark INHERITED; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 DEF_BENCH(return new StrokeBench(line_path_maker(), paint_maker(), "line_4", 4);
) | 111 DEF_BENCH(return new StrokeBench(line_path_maker(), paint_maker(), "line_4", 4);
) |
112 DEF_BENCH(return new StrokeBench(quad_path_maker(), paint_maker(), "quad_4", 4);
) | 112 DEF_BENCH(return new StrokeBench(quad_path_maker(), paint_maker(), "quad_4", 4);
) |
113 DEF_BENCH(return new StrokeBench(conic_path_maker(), paint_maker(), "conic_4", 4
);) | 113 DEF_BENCH(return new StrokeBench(conic_path_maker(), paint_maker(), "conic_4", 4
);) |
114 DEF_BENCH(return new StrokeBench(cubic_path_maker(), paint_maker(), "cubic_4", 4
);) | 114 DEF_BENCH(return new StrokeBench(cubic_path_maker(), paint_maker(), "cubic_4", 4
);) |
115 | 115 |
116 DEF_BENCH(return new StrokeBench(line_path_maker(), paint_maker(), "line_.25", .
25f);) | 116 DEF_BENCH(return new StrokeBench(line_path_maker(), paint_maker(), "line_.25", .
25f);) |
117 DEF_BENCH(return new StrokeBench(quad_path_maker(), paint_maker(), "quad_.25", .
25f);) | 117 DEF_BENCH(return new StrokeBench(quad_path_maker(), paint_maker(), "quad_.25", .
25f);) |
118 DEF_BENCH(return new StrokeBench(conic_path_maker(), paint_maker(), "conic_.25",
.25f);) | 118 DEF_BENCH(return new StrokeBench(conic_path_maker(), paint_maker(), "conic_.25",
.25f);) |
119 DEF_BENCH(return new StrokeBench(cubic_path_maker(), paint_maker(), "cubic_.25",
.25f);) | 119 DEF_BENCH(return new StrokeBench(cubic_path_maker(), paint_maker(), "cubic_.25",
.25f);) |
OLD | NEW |