Index: src/core/SkRasterClip.cpp |
diff --git a/src/core/SkRasterClip.cpp b/src/core/SkRasterClip.cpp |
index 89467677f3ec95904ff4ae540a82b031f2310bae..5a52c46212833e96aa60b9e3fec8e4556d61a409 100644 |
--- a/src/core/SkRasterClip.cpp |
+++ b/src/core/SkRasterClip.cpp |
@@ -356,6 +356,23 @@ bool SkRasterClip::quickContains(const SkIRect& ir) const { |
return fIsBW ? fBW.quickContains(ir) : fAA.quickContains(ir); |
} |
+bool SkRasterClip::quickContains(const SkRect& r) const { |
+ return fIsBW ? fBW.quickContains(r) : fAA.quickContains(r); |
+} |
+ |
+bool SkRasterClip::quickReject(const SkRect& rect) const { |
+ if (rect.isEmpty()) return true; |
+ SkIRect bounds = this->getBounds(); |
+ if (bounds.isEmpty()) return true; |
+ SkRect s32rect; |
+ if (!s32rect.intersect(rect, SkRect::MakeLargestS32())) { |
+ return true; |
+ } |
+ SkASSERT(s32rect.canRound()); |
+ const SkIRect irect = s32rect.roundOut(); |
+ return this->quickReject(irect); |
+} |
+ |
/////////////////////////////////////////////////////////////////////////////// |
const SkRegion& SkRasterClip::forceGetBW() { |