distinguish intersects-rect from intersects-rgn
git-svn-id: http://skia.googlecode.com/svn/trunk@3822 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/RegionBench.cpp b/bench/RegionBench.cpp
index a520e42..b984b62 100644
--- a/bench/RegionBench.cpp
+++ b/bench/RegionBench.cpp
@@ -35,10 +35,16 @@
return b.contains(r);
}
-static bool sects_proc(SkRegion& a, SkRegion& b) {
+static bool sectsrgn_proc(SkRegion& a, SkRegion& b) {
return a.intersects(b);
}
+static bool sectsrect_proc(SkRegion& a, SkRegion& b) {
+ SkIRect r = a.getBounds();
+ r.inset(r.width()/4, r.height()/4);
+ (void)a.intersects(r);
+}
+
static bool containsxy_proc(SkRegion& a, SkRegion& b) {
const SkIRect& r = a.getBounds();
const int dx = r.width() / 8;
@@ -107,8 +113,9 @@
static SkBenchmark* gF1(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, sect_proc, "intersect")); }
static SkBenchmark* gF2(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, diff_proc, "difference")); }
static SkBenchmark* gF3(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, containsrect_proc, "containsrect", 100)); }
-static SkBenchmark* gF4(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, sects_proc, "intersects", 10)); }
-static SkBenchmark* gF5(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, containsxy_proc, "containsxy")); }
+static SkBenchmark* gF4(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, sectsrgn_proc, "intersectsrgn", 10)); }
+static SkBenchmark* gF5(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, sectsrect_proc, "intersectsrect", 200)); }
+static SkBenchmark* gF6(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, containsxy_proc, "containsxy")); }
static BenchRegistry gR0(gF0);
static BenchRegistry gR1(gF1);
@@ -116,3 +123,4 @@
static BenchRegistry gR3(gF3);
static BenchRegistry gR4(gF4);
static BenchRegistry gR5(gF5);
+static BenchRegistry gR6(gF6);