Index: include/core/SkRegion.h |
diff --git a/include/core/SkRegion.h b/include/core/SkRegion.h |
index eb0f1367aba4a6b14bca770525bda848bcbbe9c9..a0f0e4ad3c6809dbd562894ea4ed3b754c38fe05 100644 |
--- a/include/core/SkRegion.h |
+++ b/include/core/SkRegion.h |
@@ -255,7 +255,15 @@ public: |
* specified rectangle: this = (this op rect). |
* Return true if the resulting region is non-empty. |
*/ |
- bool op(const SkIRect& rect, Op op) { return this->op(*this, rect, op); } |
+ bool op(const SkIRect& rect, Op op) { |
+ if (this->isRect() && kIntersect_Op == op) { |
+ if (!fBounds.intersect(rect)) { |
+ return this->setEmpty(); |
+ } |
+ return true; |
+ } |
+ return this->op(*this, rect, op); |
+ } |
/** |
* Set this region to the result of applying the Op to this region and the |