OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 | 8 |
9 #include "SkBenchmark.h" | 9 #include "SkBenchmark.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 fill->lineTo(xLeft, yBase); | 84 fill->lineTo(xLeft, yBase); |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 } | 88 } |
89 | 89 |
90 // A set of scrolling line plots with the area between each plot filled. Stresse
s out GPU path | 90 // A set of scrolling line plots with the area between each plot filled. Stresse
s out GPU path |
91 // filling | 91 // filling |
92 class ChartBench : public SkBenchmark { | 92 class ChartBench : public SkBenchmark { |
93 public: | 93 public: |
94 ChartBench(void* param, bool aa) : SkBenchmark(param) { | 94 ChartBench(bool aa) { |
95 fShift = 0; | 95 fShift = 0; |
96 fAA = aa; | 96 fAA = aa; |
97 fSize.fWidth = -1; | 97 fSize.fWidth = -1; |
98 fSize.fHeight = -1; | 98 fSize.fHeight = -1; |
99 } | 99 } |
100 | 100 |
101 protected: | 101 protected: |
102 virtual const char* onGetName() SK_OVERRIDE { | 102 virtual const char* onGetName() SK_OVERRIDE { |
103 if (fAA) { | 103 if (fAA) { |
104 return "chart_aa"; | 104 return "chart_aa"; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 int fShift; | 187 int fShift; |
188 SkISize fSize; | 188 SkISize fSize; |
189 SkTDArray<SkScalar> fData[kNumGraphs]; | 189 SkTDArray<SkScalar> fData[kNumGraphs]; |
190 bool fAA; | 190 bool fAA; |
191 | 191 |
192 typedef SkBenchmark INHERITED; | 192 typedef SkBenchmark INHERITED; |
193 }; | 193 }; |
194 | 194 |
195 ////////////////////////////////////////////////////////////////////////////// | 195 ////////////////////////////////////////////////////////////////////////////// |
196 | 196 |
197 static SkBenchmark* Fact0(void* p) { return new ChartBench(p, true); } | 197 DEF_BENCH( return new ChartBench(true); ) |
198 static SkBenchmark* Fact1(void* p) { return new ChartBench(p, false); } | 198 DEF_BENCH( return new ChartBench(false); ) |
199 | |
200 static BenchRegistry gReg0(Fact0); | |
201 static BenchRegistry gReg1(Fact1); | |
OLD | NEW |