diff options
author | reed <reed@chromium.org> | 2014-10-10 05:50:15 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-10 05:50:15 -0700 |
commit | 40636a53037eadd957b8e43f0961f640aaa93e84 (patch) | |
tree | ddd687900a7bb6965c63e97663deefd7c11f0015 /bench/GeometryBench.cpp | |
parent | 0ad24bee47e734b1a8f86f40d7eb240cc20c618c (diff) |
faster SkRect::sort
BUG=skia:
Review URL: https://codereview.chromium.org/646863002
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; ) |