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" |
11 #include "SkPath.h" | |
12 #include "SkRandom.h" | 11 #include "SkRandom.h" |
13 #include "SkTDArray.h" | |
14 | 12 |
15 /** | 13 /** |
16 * This is a conversion of samplecode/SampleChart.cpp into a bench. It sure woul
d be nice to be able | 14 * This is a conversion of samplecode/SampleChart.cpp into a bench. It sure woul
d be nice to be able |
17 * to write one subclass that can be a GM, bench, and/or Sample. | 15 * to write one subclass that can be a GM, bench, and/or Sample. |
18 */ | 16 */ |
19 | 17 |
20 // Generates y values for the chart plots. | 18 // Generates y values for the chart plots. |
21 static void gen_data(SkScalar yAvg, SkScalar ySpread, int count, | 19 static void gen_data(SkScalar yAvg, SkScalar ySpread, int count, |
22 SkRandom* random, SkTDArray<SkScalar>* dataPts) { | 20 SkRandom* random, SkTDArray<SkScalar>* dataPts) { |
23 dataPts->setCount(count); | 21 dataPts->setCount(count); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 SkTDArray<SkScalar> fData[kNumGraphs]; | 183 SkTDArray<SkScalar> fData[kNumGraphs]; |
186 bool fAA; | 184 bool fAA; |
187 | 185 |
188 typedef Benchmark INHERITED; | 186 typedef Benchmark INHERITED; |
189 }; | 187 }; |
190 | 188 |
191 ////////////////////////////////////////////////////////////////////////////// | 189 ////////////////////////////////////////////////////////////////////////////// |
192 | 190 |
193 DEF_BENCH( return new ChartBench(true); ) | 191 DEF_BENCH( return new ChartBench(true); ) |
194 DEF_BENCH( return new ChartBench(false); ) | 192 DEF_BENCH( return new ChartBench(false); ) |
OLD | NEW |