| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 static inline SkIRect make_concentric_rects_decreasing(SkMWCRandom&, int index,
int numRects) { | 162 static inline SkIRect make_concentric_rects_decreasing(SkMWCRandom&, int index,
int numRects) { |
| 163 SkIRect out = {0, 0, numRects - index, numRects - index}; | 163 SkIRect out = {0, 0, numRects - index, numRects - index}; |
| 164 return out; | 164 return out; |
| 165 } | 165 } |
| 166 | 166 |
| 167 static inline SkIRect make_XYordered_rects(SkMWCRandom& rand, int index, int num
Rects) { | 167 static inline SkIRect make_XYordered_rects(SkMWCRandom& rand, int index, int num
Rects) { |
| 168 SkIRect out; | 168 SkIRect out; |
| 169 out.fLeft = index % GRID_WIDTH; | 169 out.fLeft = index % GRID_WIDTH; |
| 170 out.fTop = index / GRID_WIDTH; | 170 out.fTop = index / GRID_WIDTH; |
| 171 out.fRight = 1 + rand.nextU() % (GENERATE_EXTENTS / 3); | 171 out.fRight = fLeft + 1 + rand.nextU() % (GENERATE_EXTENTS / 3); |
| 172 out.fBottom = 1 + rand.nextU() % (GENERATE_EXTENTS / 3); | 172 out.fBottom = fTop + 1 + rand.nextU() % (GENERATE_EXTENTS / 3); |
| 173 return out; | 173 return out; |
| 174 } | 174 } |
| 175 static inline SkIRect make_YXordered_rects(SkMWCRandom& rand, int index, int num
Rects) { | 175 static inline SkIRect make_YXordered_rects(SkMWCRandom& rand, int index, int num
Rects) { |
| 176 SkIRect out; | 176 SkIRect out; |
| 177 out.fLeft = index / GRID_WIDTH; | 177 out.fLeft = index / GRID_WIDTH; |
| 178 out.fTop = index % GRID_WIDTH; | 178 out.fTop = index % GRID_WIDTH; |
| 179 out.fRight = 1 + rand.nextU() % (GENERATE_EXTENTS / 3); | 179 out.fRight = fLeft + 1 + rand.nextU() % (GENERATE_EXTENTS / 3); |
| 180 out.fBottom = 1 + rand.nextU() % (GENERATE_EXTENTS / 3); | 180 out.fBottom = fTop + 1 + rand.nextU() % (GENERATE_EXTENTS / 3); |
| 181 return out; | 181 return out; |
| 182 } | 182 } |
| 183 | 183 |
| 184 static inline SkIRect make_point_rects(SkMWCRandom& rand, int index, int numRect
s) { | 184 static inline SkIRect make_point_rects(SkMWCRandom& rand, int index, int numRect
s) { |
| 185 SkIRect out; | 185 SkIRect out; |
| 186 out.fLeft = rand.nextU() % GENERATE_EXTENTS; | 186 out.fLeft = rand.nextU() % GENERATE_EXTENTS; |
| 187 out.fTop = rand.nextU() % GENERATE_EXTENTS; | 187 out.fTop = rand.nextU() % GENERATE_EXTENTS; |
| 188 out.fRight = out.fLeft + (GENERATE_EXTENTS / 200); | 188 out.fRight = out.fLeft + (GENERATE_EXTENTS / 200); |
| 189 out.fBottom = out.fTop + (GENERATE_EXTENTS / 200); | 189 out.fBottom = out.fTop + (GENERATE_EXTENTS / 200); |
| 190 return out; | 190 return out; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 static BenchRegistry gReg8(Fact8); | 303 static BenchRegistry gReg8(Fact8); |
| 304 static BenchRegistry gReg7(Fact7); | 304 static BenchRegistry gReg7(Fact7); |
| 305 static BenchRegistry gReg6(Fact6); | 305 static BenchRegistry gReg6(Fact6); |
| 306 static BenchRegistry gReg5(Fact5); | 306 static BenchRegistry gReg5(Fact5); |
| 307 static BenchRegistry gReg4(Fact4); | 307 static BenchRegistry gReg4(Fact4); |
| 308 static BenchRegistry gReg3(Fact3); | 308 static BenchRegistry gReg3(Fact3); |
| 309 static BenchRegistry gReg2(Fact2); | 309 static BenchRegistry gReg2(Fact2); |
| 310 static BenchRegistry gReg1(Fact1); | 310 static BenchRegistry gReg1(Fact1); |
| 311 static BenchRegistry gReg0(Fact0); | 311 static BenchRegistry gReg0(Fact0); |
| 312 | 312 |
| OLD | NEW |