aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/SkRegion.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp
index 09550571e6..acc530a94d 100644
--- a/src/core/SkRegion.cpp
+++ b/src/core/SkRegion.cpp
@@ -124,6 +124,15 @@ void SkRegion::swap(SkRegion& other) {
SkTSwap<RunHead*>(fRunHead, other.fRunHead);
}
+int SkRegion::computeRegionComplexity() const {
+ if (this->isEmpty()) {
+ return 0;
+ } else if (this->isRect()) {
+ return 1;
+ }
+ return fRunHead->getIntervalCount();
+}
+
bool SkRegion::setEmpty() {
this->freeRuns();
fBounds.set(0, 0, 0, 0);