This source file includes following definitions.
- CreateNativeRegion
- IntersectRegions
- CombineRegions
- SubtractRegion
#include "ui/gfx/path.h"
#include "base/memory/scoped_ptr.h"
#include "third_party/skia/include/core/SkRegion.h"
namespace gfx {
SkRegion* Path::CreateNativeRegion() const {
const SkRect bounds = getBounds();
SkIRect ibounds;
bounds.round(&ibounds);
SkRegion clip_region;
clip_region.setRect(ibounds);
SkRegion* region = new SkRegion;
region->setPath(*this, clip_region);
return region;
}
NativeRegion Path::IntersectRegions(NativeRegion r1, NativeRegion r2) {
SkRegion* new_region = new SkRegion;
new_region->op(*r1, *r2, SkRegion::kIntersect_Op);
return new_region;
}
NativeRegion Path::CombineRegions(NativeRegion r1, NativeRegion r2) {
SkRegion* new_region = new SkRegion;
new_region->op(*r1, *r2, SkRegion::kUnion_Op);
return new_region;
}
NativeRegion Path::SubtractRegion(NativeRegion r1, NativeRegion r2) {
SkRegion* new_region = new SkRegion;
new_region->op(*r1, *r2, SkRegion::kDifference_Op);
return new_region;
}
}