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" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 fill->lineTo(x, topData[i + leftShift]); | 57 fill->lineTo(x, topData[i + leftShift]); |
58 x += xDelta; | 58 x += xDelta; |
59 } | 59 } |
60 | 60 |
61 for (int i = 0; i < leftShift; ++i) { | 61 for (int i = 0; i < leftShift; ++i) { |
62 plot->lineTo(x, topData[i]); | 62 plot->lineTo(x, topData[i]); |
63 fill->lineTo(x, topData[i]); | 63 fill->lineTo(x, topData[i]); |
64 x += xDelta; | 64 x += xDelta; |
65 } | 65 } |
66 | 66 |
67 if (NULL != bottomData) { | 67 if (bottomData) { |
68 SkASSERT(bottomData->count() == topData.count()); | 68 SkASSERT(bottomData->count() == topData.count()); |
69 // iterate backwards over the previous graph's data to generate the bott
om of the filled | 69 // iterate backwards over the previous graph's data to generate the bott
om of the filled |
70 // area (and account for leftShift). | 70 // area (and account for leftShift). |
71 for (int i = 0; i < leftShift; ++i) { | 71 for (int i = 0; i < leftShift; ++i) { |
72 x -= xDelta; | 72 x -= xDelta; |
73 fill->lineTo(x, (*bottomData)[leftShift - 1 - i]); | 73 fill->lineTo(x, (*bottomData)[leftShift - 1 - i]); |
74 } | 74 } |
75 for (int i = 0; i < shiftToEndCount; ++i) { | 75 for (int i = 0; i < shiftToEndCount; ++i) { |
76 x -= xDelta; | 76 x -= xDelta; |
77 fill->lineTo(x, (*bottomData)[bottomData->count() - 1 - i]); | 77 fill->lineTo(x, (*bottomData)[bottomData->count() - 1 - i]); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 SkTDArray<SkScalar> fData[kNumGraphs]; | 183 SkTDArray<SkScalar> fData[kNumGraphs]; |
184 bool fAA; | 184 bool fAA; |
185 | 185 |
186 typedef Benchmark INHERITED; | 186 typedef Benchmark INHERITED; |
187 }; | 187 }; |
188 | 188 |
189 ////////////////////////////////////////////////////////////////////////////// | 189 ////////////////////////////////////////////////////////////////////////////// |
190 | 190 |
191 DEF_BENCH( return new ChartBench(true); ) | 191 DEF_BENCH( return new ChartBench(true); ) |
192 DEF_BENCH( return new ChartBench(false); ) | 192 DEF_BENCH( return new ChartBench(false); ) |
OLD | NEW |