Index: include/core/SkRect.h |
diff --git a/include/core/SkRect.h b/include/core/SkRect.h |
index b2f515129d05bf9a0cca392f880f0d6c75d22e25..9f3b59a38f7a29936de4dc0c9cc4564ae3472278 100644 |
--- a/include/core/SkRect.h |
+++ b/include/core/SkRect.h |
@@ -26,6 +26,12 @@ struct SK_API SkIRect { |
return r; |
} |
+ static SkIRect SK_WARN_UNUSED_RESULT MakeLargest() { |
+ SkIRect r; |
+ r.setLargest(); |
+ return r; |
+ } |
+ |
static SkIRect SK_WARN_UNUSED_RESULT MakeWH(int32_t w, int32_t h) { |
SkIRect r; |
r.set(0, 0, w, h); |
@@ -94,6 +100,11 @@ struct SK_API SkIRect { |
*/ |
bool isEmpty() const { return fLeft >= fRight || fTop >= fBottom; } |
+ bool isLargest() const { return SK_MinS32 == fLeft && |
+ SK_MinS32 == fTop && |
+ SK_MaxS32 == fRight && |
+ SK_MaxS32 == fBottom; } |
+ |
friend bool operator==(const SkIRect& a, const SkIRect& b) { |
return !memcmp(&a, &b, sizeof(a)); |
} |