OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 return fName.c_str(); | 50 return fName.c_str(); |
51 } | 51 } |
52 | 52 |
53 void onDraw(const int loops, SkCanvas* canvas) override { | 53 void onDraw(const int loops, SkCanvas* canvas) override { |
54 SkPaint paint(fPaint); | 54 SkPaint paint(fPaint); |
55 this->setupPaint(&paint); | 55 this->setupPaint(&paint); |
56 | 56 |
57 SkPath path; | 57 SkPath path; |
58 this->makePath(&path); | 58 this->makePath(&path); |
59 if (fFlags & kBig_Flag) { | 59 if (fFlags & kBig_Flag) { |
60 SkMatrix m; | 60 const SkMatrix m = SkMatrix::MakeScale(SkIntToScalar(10), SkIntToSca
lar(10)); |
61 m.setScale(SkIntToScalar(10), SkIntToScalar(10)); | |
62 path.transform(m); | 61 path.transform(m); |
63 } | 62 } |
64 | 63 |
65 int count = loops; | 64 int count = loops; |
66 if (fFlags & kBig_Flag) { | 65 if (fFlags & kBig_Flag) { |
67 count >>= 2; | 66 count >>= 2; |
68 } | 67 } |
69 count >>= (3 * complexity()); | 68 count >>= (3 * complexity()); |
70 | 69 |
71 for (int i = 0; i < count; i++) { | 70 for (int i = 0; i < count; i++) { |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 DEF_BENCH( return new ConservativelyContainsBench(ConservativelyContainsBench::k
Oval_Type); ) | 1041 DEF_BENCH( return new ConservativelyContainsBench(ConservativelyContainsBench::k
Oval_Type); ) |
1043 | 1042 |
1044 | 1043 |
1045 // These seem to be optimized away, which is troublesome for timing. | 1044 // These seem to be optimized away, which is troublesome for timing. |
1046 /* | 1045 /* |
1047 DEF_BENCH( return new ConicBench_Chop5() ) | 1046 DEF_BENCH( return new ConicBench_Chop5() ) |
1048 DEF_BENCH( return new ConicBench_ComputeError() ) | 1047 DEF_BENCH( return new ConicBench_ComputeError() ) |
1049 DEF_BENCH( return new ConicBench_asQuadTol() ) | 1048 DEF_BENCH( return new ConicBench_asQuadTol() ) |
1050 DEF_BENCH( return new ConicBench_quadPow2() ) | 1049 DEF_BENCH( return new ConicBench_quadPow2() ) |
1051 */ | 1050 */ |
OLD | NEW |