distinguish intersects-rect from intersects-rgn

git-svn-id: http://skia.googlecode.com/svn/trunk@3822 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2012-05-02 17:20:02 +00:00
parent 46af7efbee
commit 4b4f86d34d

View File

@ -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);