diff options
Diffstat (limited to 'bench/GeometryBench.cpp')
-rw-r--r-- | bench/GeometryBench.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/bench/GeometryBench.cpp b/bench/GeometryBench.cpp index cd58e3cdaf..a5c4643f9e 100644 --- a/bench/GeometryBench.cpp +++ b/bench/GeometryBench.cpp @@ -97,7 +97,7 @@ protected: class GeoRectBench_Intersects : public GeoRectBench { public: GeoRectBench_Intersects() : GeoRectBench("rect_Intersects") {} - + protected: virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE { for (int outer = 0; outer < loops; ++outer) { @@ -110,6 +110,22 @@ protected: } }; +class GeoRectBench_sort : public GeoRectBench { +public: + GeoRectBench_sort() : GeoRectBench("rect_sort") {} + +protected: + virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE { + for (int outer = 0; outer < loops; ++outer) { + for (size_t i = 0; i < SK_ARRAY_COUNT(fRects); ++i) { + fRects[i].sort(); + } + } + } +}; + DEF_BENCH( return new GeoRectBench_intersect; ) DEF_BENCH( return new GeoRectBench_intersect_rect; ) DEF_BENCH( return new GeoRectBench_Intersects; ) + +DEF_BENCH( return new GeoRectBench_sort; ) |