Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: bench/GeometryBench.cpp

Issue 646863002: faster SkRect::sort (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkRect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/GeometryBench.cpp
diff --git a/bench/GeometryBench.cpp b/bench/GeometryBench.cpp
index cd58e3cdaf391b0e232dd5beb27054de34f877b4..a5c4643f9e32b384a30eab0471e6eb92fb06de6c 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; )
« no previous file with comments | « no previous file | include/core/SkRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698