OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkRTree.h" | 10 #include "SkRTree.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 out.fBottom = out.fTop + 1 + rand.nextRangeF(0, GENERATE_EXTENTS/5); | 120 out.fBottom = out.fTop + 1 + rand.nextRangeF(0, GENERATE_EXTENTS/5); |
121 return out; | 121 return out; |
122 } | 122 } |
123 | 123 |
124 static inline SkRect make_concentric_rects(SkRandom&, int index, int numRects) { | 124 static inline SkRect make_concentric_rects(SkRandom&, int index, int numRects) { |
125 return SkRect::MakeWH(SkIntToScalar(index+1), SkIntToScalar(index+1)); | 125 return SkRect::MakeWH(SkIntToScalar(index+1), SkIntToScalar(index+1)); |
126 } | 126 } |
127 | 127 |
128 /////////////////////////////////////////////////////////////////////////////// | 128 /////////////////////////////////////////////////////////////////////////////// |
129 | 129 |
130 DEF_BENCH(return SkNEW_ARGS(RTreeBuildBench, ("XY", &make_XYordered_rect
s))); | 130 DEF_BENCH(return new RTreeBuildBench("XY", &make_XYordered_rects)); |
131 DEF_BENCH(return SkNEW_ARGS(RTreeBuildBench, ("YX", &make_YXordered_rect
s))); | 131 DEF_BENCH(return new RTreeBuildBench("YX", &make_YXordered_rects)); |
132 DEF_BENCH(return SkNEW_ARGS(RTreeBuildBench, ("random", &make_random_rects))
); | 132 DEF_BENCH(return new RTreeBuildBench("random", &make_random_rects)); |
133 DEF_BENCH(return SkNEW_ARGS(RTreeBuildBench, ("concentric", &make_concentric_rec
ts))); | 133 DEF_BENCH(return new RTreeBuildBench("concentric", &make_concentric_rects)); |
134 | 134 |
135 DEF_BENCH(return SkNEW_ARGS(RTreeQueryBench, ("XY", &make_XYordered_rect
s))); | 135 DEF_BENCH(return new RTreeQueryBench("XY", &make_XYordered_rects)); |
136 DEF_BENCH(return SkNEW_ARGS(RTreeQueryBench, ("YX", &make_YXordered_rect
s))); | 136 DEF_BENCH(return new RTreeQueryBench("YX", &make_YXordered_rects)); |
137 DEF_BENCH(return SkNEW_ARGS(RTreeQueryBench, ("random", &make_random_rects))
); | 137 DEF_BENCH(return new RTreeQueryBench("random", &make_random_rects)); |
138 DEF_BENCH(return SkNEW_ARGS(RTreeQueryBench, ("concentric", &make_concentric_rec
ts))); | 138 DEF_BENCH(return new RTreeQueryBench("concentric", &make_concentric_rects)); |
OLD | NEW |