| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include "Benchmark.h" | 8 #include "Benchmark.h" |
| 9 #include "SkFloatBits.h" | 9 #include "SkFloatBits.h" |
| 10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 protected: | 147 protected: |
| 148 const char* onGetName() SK_OVERRIDE { | 148 const char* onGetName() SK_OVERRIDE { |
| 149 return "rect_bounds"; | 149 return "rect_bounds"; |
| 150 } | 150 } |
| 151 | 151 |
| 152 void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE { | 152 void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE { |
| 153 SkRect r; | 153 SkRect r; |
| 154 for (int i = 0; i < loops; ++i) { | 154 for (int i = 0; i < loops; ++i) { |
| 155 r.set(fPts, PTS); | 155 for (int i = 0; i < 1000; ++i) { |
| 156 r.set(fPts, PTS); |
| 157 } |
| 156 } | 158 } |
| 157 } | 159 } |
| 158 | 160 |
| 159 private: | 161 private: |
| 160 typedef Benchmark INHERITED; | 162 typedef Benchmark INHERITED; |
| 161 }; | 163 }; |
| 162 | 164 |
| 163 /////////////////////////////////////////////////////////////////////////////// | 165 /////////////////////////////////////////////////////////////////////////////// |
| 164 | 166 |
| 165 DEF_BENCH( return new FloatComparisonBench(); ) | 167 DEF_BENCH( return new FloatComparisonBench(); ) |
| 166 DEF_BENCH( return new ForcedIntComparisonBench(); ) | 168 DEF_BENCH( return new ForcedIntComparisonBench(); ) |
| 167 DEF_BENCH( return new RectBoundsBench(); ) | 169 DEF_BENCH( return new RectBoundsBench(); ) |
| 168 DEF_BENCH( return new IsFiniteScalarBench(); ) | 170 DEF_BENCH( return new IsFiniteScalarBench(); ) |
| OLD | NEW |