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 #include "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkCommandLineFlags.h" | 10 #include "SkCommandLineFlags.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 SkRRect fRRect; | 241 SkRRect fRRect; |
242 SkRRect fInnerRect; | 242 SkRRect fInnerRect; |
243 SkRRect fInnerOval; | 243 SkRRect fInnerOval; |
244 SkRRect fInnerRRect; | 244 SkRRect fInnerRRect; |
245 SkTArray<ShapeInfo> fShapes; | 245 SkTArray<ShapeInfo> fShapes; |
246 | 246 |
247 | 247 |
248 typedef Benchmark INHERITED; | 248 typedef Benchmark INHERITED; |
249 }; | 249 }; |
250 | 250 |
| 251 #if ENABLE_COMMAND_LINE_SHAPES_BENCH |
| 252 DEF_BENCH(return new ShapesBench;) |
| 253 #else |
251 // Small primitives (CPU bound, in theory): | 254 // Small primitives (CPU bound, in theory): |
252 DEF_BENCH(return new ShapesBench(ShapesBench::kRect_ShapesType, ShapesBench::kNo
ne_ShapesType, | 255 DEF_BENCH(return new ShapesBench(ShapesBench::kRect_ShapesType, ShapesBench::kNo
ne_ShapesType, |
253 10000, SkISize::Make(32, 32), false);) | 256 10000, SkISize::Make(32, 32), false);) |
254 DEF_BENCH(return new ShapesBench(ShapesBench::kOval_ShapesType, ShapesBench::kNo
ne_ShapesType, | 257 DEF_BENCH(return new ShapesBench(ShapesBench::kOval_ShapesType, ShapesBench::kNo
ne_ShapesType, |
255 10000, SkISize::Make(32, 32), false);) | 258 10000, SkISize::Make(32, 32), false);) |
256 DEF_BENCH(return new ShapesBench(ShapesBench::kOval_ShapesType, ShapesBench::kNo
ne_ShapesType, | 259 DEF_BENCH(return new ShapesBench(ShapesBench::kOval_ShapesType, ShapesBench::kNo
ne_ShapesType, |
257 10000, SkISize::Make(32, 33), false);) | 260 10000, SkISize::Make(32, 33), false);) |
258 DEF_BENCH(return new ShapesBench(ShapesBench::kRRect_ShapesType, ShapesBench::kN
one_ShapesType, | 261 DEF_BENCH(return new ShapesBench(ShapesBench::kRRect_ShapesType, ShapesBench::kN
one_ShapesType, |
259 10000, SkISize::Make(32, 32), false);) | 262 10000, SkISize::Make(32, 32), false);) |
260 DEF_BENCH(return new ShapesBench(ShapesBench::kMixed_ShapesType, ShapesBench::kN
one_ShapesType, | 263 DEF_BENCH(return new ShapesBench(ShapesBench::kMixed_ShapesType, ShapesBench::kN
one_ShapesType, |
(...skipping 14 matching lines...) Expand all Loading... |
275 // Donuts (small and large). These fall-back to path rendering due to non-orthog
onal rotation | 278 // Donuts (small and large). These fall-back to path rendering due to non-orthog
onal rotation |
276 // making them quite slow. Thus, reduce the counts substantially: | 279 // making them quite slow. Thus, reduce the counts substantially: |
277 DEF_BENCH(return new ShapesBench(ShapesBench::kRect_ShapesType, ShapesBench::kRe
ct_ShapesType, | 280 DEF_BENCH(return new ShapesBench(ShapesBench::kRect_ShapesType, ShapesBench::kRe
ct_ShapesType, |
278 500, SkISize::Make(32, 32), false);) | 281 500, SkISize::Make(32, 32), false);) |
279 DEF_BENCH(return new ShapesBench(ShapesBench::kRRect_ShapesType, ShapesBench::kR
Rect_ShapesType, | 282 DEF_BENCH(return new ShapesBench(ShapesBench::kRRect_ShapesType, ShapesBench::kR
Rect_ShapesType, |
280 500, SkISize::Make(32, 32), false);) | 283 500, SkISize::Make(32, 32), false);) |
281 DEF_BENCH(return new ShapesBench(ShapesBench::kRect_ShapesType, ShapesBench::kRe
ct_ShapesType, | 284 DEF_BENCH(return new ShapesBench(ShapesBench::kRect_ShapesType, ShapesBench::kRe
ct_ShapesType, |
282 50, SkISize::Make(500, 500), false);) | 285 50, SkISize::Make(500, 500), false);) |
283 DEF_BENCH(return new ShapesBench(ShapesBench::kRRect_ShapesType, ShapesBench::kR
Rect_ShapesType, | 286 DEF_BENCH(return new ShapesBench(ShapesBench::kRRect_ShapesType, ShapesBench::kR
Rect_ShapesType, |
284 50, SkISize::Make(500, 500), false);) | 287 50, SkISize::Make(500, 500), false);) |
285 | |
286 #if ENABLE_COMMAND_LINE_SHAPES_BENCH | |
287 DEF_BENCH(return new ShapesBench;) | |
288 #endif | 288 #endif |
OLD | NEW |