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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 typedef PathBench INHERITED; | 141 typedef PathBench INHERITED; |
142 }; | 142 }; |
143 | 143 |
144 class SawToothPathBench : public PathBench { | 144 class SawToothPathBench : public PathBench { |
145 public: | 145 public: |
146 SawToothPathBench(Flags flags) : INHERITED(flags) {} | 146 SawToothPathBench(Flags flags) : INHERITED(flags) {} |
147 | 147 |
148 void appendName(SkString* name) override { | 148 void appendName(SkString* name) override { |
149 name->append("sawtooth"); | 149 name->append("sawtooth"); |
150 } | 150 } |
151 virtual void makePath(SkPath* path) { | 151 void makePath(SkPath* path) override { |
152 SkScalar x = SkIntToScalar(20); | 152 SkScalar x = SkIntToScalar(20); |
153 SkScalar y = SkIntToScalar(20); | 153 SkScalar y = SkIntToScalar(20); |
154 const SkScalar x0 = x; | 154 const SkScalar x0 = x; |
155 const SkScalar dx = SK_Scalar1 * 5; | 155 const SkScalar dx = SK_Scalar1 * 5; |
156 const SkScalar dy = SK_Scalar1 * 10; | 156 const SkScalar dy = SK_Scalar1 * 10; |
157 | 157 |
158 path->moveTo(x, y); | 158 path->moveTo(x, y); |
159 for (int i = 0; i < 32; i++) { | 159 for (int i = 0; i < 32; i++) { |
160 x += dx; | 160 x += dx; |
161 path->lineTo(x, y - dy); | 161 path->lineTo(x, y - dy); |
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 DEF_BENCH( return new ConservativelyContainsBench(ConservativelyContainsBench::k
Oval_Type); ) | 1041 DEF_BENCH( return new ConservativelyContainsBench(ConservativelyContainsBench::k
Oval_Type); ) |
1042 | 1042 |
1043 | 1043 |
1044 // These seem to be optimized away, which is troublesome for timing. | 1044 // These seem to be optimized away, which is troublesome for timing. |
1045 /* | 1045 /* |
1046 DEF_BENCH( return new ConicBench_Chop5() ) | 1046 DEF_BENCH( return new ConicBench_Chop5() ) |
1047 DEF_BENCH( return new ConicBench_ComputeError() ) | 1047 DEF_BENCH( return new ConicBench_ComputeError() ) |
1048 DEF_BENCH( return new ConicBench_asQuadTol() ) | 1048 DEF_BENCH( return new ConicBench_asQuadTol() ) |
1049 DEF_BENCH( return new ConicBench_quadPow2() ) | 1049 DEF_BENCH( return new ConicBench_quadPow2() ) |
1050 */ | 1050 */ |
OLD | NEW |