diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-02 17:20:02 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-02 17:20:02 +0000 |
commit | 4b4f86d34de000e38cc03bce5995a132e13e3c8c (patch) | |
tree | 2951f4c20b386b83b2878522e13e4f4b1f2ae657 /bench/RegionBench.cpp | |
parent | 46af7efbeecca4c0d9650378c8fe6add194f231e (diff) |
distinguish intersects-rect from intersects-rgn
git-svn-id: http://skia.googlecode.com/svn/trunk@3822 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/RegionBench.cpp')
-rw-r--r-- | bench/RegionBench.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/bench/RegionBench.cpp b/bench/RegionBench.cpp index a520e4245d..b984b62f55 100644 --- a/bench/RegionBench.cpp +++ b/bench/RegionBench.cpp @@ -35,10 +35,16 @@ static bool containsrect_proc(SkRegion& a, SkRegion& b) { 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* gF0(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, uni 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 gR2(gF2); static BenchRegistry gR3(gF3); static BenchRegistry gR4(gF4); static BenchRegistry gR5(gF5); +static BenchRegistry gR6(gF6); |