Index: src/core/SkRasterClip.h |
diff --git a/src/core/SkRasterClip.h b/src/core/SkRasterClip.h |
index 0c2723314ccb3cc9fe1e3651990c0b8797456b13..29a925f2a283ade5ebc0d0125e40a1d4a2212deb 100644 |
--- a/src/core/SkRasterClip.h |
+++ b/src/core/SkRasterClip.h |
@@ -89,11 +89,19 @@ private: |
} |
bool computeIsRect() const { |
- return fIsBW ? fBW.isRect() : false; |
+ return fIsBW ? fBW.isRect() : fAA.isRect(); |
} |
- bool updateCacheAndReturnNonEmpty() { |
+ bool updateCacheAndReturnNonEmpty(bool detectAARect = true) { |
fIsEmpty = this->computeIsEmpty(); |
+ |
+ // detect that our computed AA is really just a (hard-edged) rect |
+ if (detectAARect && !fIsEmpty && !fIsBW && fAA.isRect()) { |
+ fBW.setRect(fAA.getBounds()); |
+ fAA.setEmpty(); // don't need this guy anymore |
+ fIsBW = true; |
+ } |
+ |
fIsRect = this->computeIsRect(); |
return !fIsEmpty; |
} |