| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkGeometry.h" | 9 #include "SkGeometry.h" |
| 10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 count += r.intersect(fRects[0], fRects[i]); | 90 count += r.intersect(fRects[0], fRects[i]); |
| 91 } | 91 } |
| 92 this->virtualCallToFoilOptimizers(count); | 92 this->virtualCallToFoilOptimizers(count); |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 class GeoRectBench_Intersects : public GeoRectBench { | 97 class GeoRectBench_Intersects : public GeoRectBench { |
| 98 public: | 98 public: |
| 99 GeoRectBench_Intersects() : GeoRectBench("rect_Intersects") {} | 99 GeoRectBench_Intersects() : GeoRectBench("rect_Intersects") {} |
| 100 | 100 |
| 101 protected: | 101 protected: |
| 102 void onDraw(int loops, SkCanvas* canvas) override { | 102 void onDraw(int loops, SkCanvas* canvas) override { |
| 103 for (int outer = 0; outer < loops; ++outer) { | 103 for (int outer = 0; outer < loops; ++outer) { |
| 104 int count = 0; | 104 int count = 0; |
| 105 for (size_t i = 0; i < SK_ARRAY_COUNT(fRects); ++i) { | 105 for (size_t i = 0; i < SK_ARRAY_COUNT(fRects); ++i) { |
| 106 count += SkRect::Intersects(fRects[0], fRects[i]); | 106 count += SkRect::Intersects(fRects[0], fRects[i]); |
| 107 } | 107 } |
| 108 this->virtualCallToFoilOptimizers(count); | 108 this->virtualCallToFoilOptimizers(count); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 class GeoRectBench_sort : public GeoRectBench { | 113 class GeoRectBench_sort : public GeoRectBench { |
| 114 public: | 114 public: |
| 115 GeoRectBench_sort() : GeoRectBench("rect_sort") {} | 115 GeoRectBench_sort() : GeoRectBench("rect_sort") {} |
| 116 | 116 |
| 117 protected: | 117 protected: |
| 118 void onDraw(int loops, SkCanvas* canvas) override { | 118 void onDraw(int loops, SkCanvas* canvas) override { |
| 119 for (int outer = 0; outer < loops; ++outer) { | 119 for (int outer = 0; outer < loops; ++outer) { |
| 120 for (size_t i = 0; i < SK_ARRAY_COUNT(fRects); ++i) { | 120 for (size_t i = 0; i < SK_ARRAY_COUNT(fRects); ++i) { |
| 121 fRects[i].sort(); | 121 fRects[i].sort(); |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 }; | 125 }; |
| 126 | 126 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 SkPoint dst[7]; | 236 SkPoint dst[7]; |
| 237 for (int outer = 0; outer < loops; ++outer) { | 237 for (int outer = 0; outer < loops; ++outer) { |
| 238 SkChopCubicAt(fPts, dst, 0.5f); | 238 SkChopCubicAt(fPts, dst, 0.5f); |
| 239 SkChopCubicAt(fPts, dst, 0.5f); | 239 SkChopCubicAt(fPts, dst, 0.5f); |
| 240 SkChopCubicAt(fPts, dst, 0.5f); | 240 SkChopCubicAt(fPts, dst, 0.5f); |
| 241 SkChopCubicAt(fPts, dst, 0.5f); | 241 SkChopCubicAt(fPts, dst, 0.5f); |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 }; | 244 }; |
| 245 DEF_BENCH( return new ChopCubicAt; ) | 245 DEF_BENCH( return new ChopCubicAt; ) |
| 246 | |
| OLD | NEW |