optimize region::intersect when one wholly contains the other
clone of https://codereview.appspot.com/7237055/ git-svn-id: http://skia.googlecode.com/svn/trunk@7491 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
a3c1348976
commit
633c32b13b
@ -36,6 +36,7 @@
|
||||
'../bench/RectBench.cpp',
|
||||
'../bench/RefCntBench.cpp',
|
||||
'../bench/RegionBench.cpp',
|
||||
'../bench/RegionContainBench.cpp',
|
||||
'../bench/RepeatTileBench.cpp',
|
||||
'../bench/RTreeBench.cpp',
|
||||
'../bench/ScalarBench.cpp',
|
||||
|
@ -1019,6 +1019,12 @@ bool SkRegion::Oper(const SkRegion& rgnaOrig, const SkRegion& rgnbOrig, Op op,
|
||||
if (a_rect & b_rect) {
|
||||
return setRectCheck(result, bounds);
|
||||
}
|
||||
if (a_rect && rgna->fBounds.contains(rgnb->fBounds)) {
|
||||
return setRegionCheck(result, *rgnb);
|
||||
}
|
||||
if (b_rect && rgnb->fBounds.contains(rgna->fBounds)) {
|
||||
return setRegionCheck(result, *rgna);
|
||||
}
|
||||
break;
|
||||
|
||||
case kUnion_Op:
|
||||
|
Loading…
Reference in New Issue
Block a user