diff options
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkRect.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/core/SkRect.h b/include/core/SkRect.h index 2cc2604941..12afddd9ce 100644 --- a/include/core/SkRect.h +++ b/include/core/SkRect.h @@ -411,6 +411,14 @@ struct SK_API SkRect { return r; } + // The largest SkRect for which round() is well-defined. + static SkRect SK_WARN_UNUSED_RESULT MakeLargestS32() { + const SkRect r = MakeLTRB(SK_MinS32FitsInFloat, SK_MinS32FitsInFloat, + SK_MaxS32FitsInFloat, SK_MaxS32FitsInFloat); + SkASSERT(r == Make(r.roundOut())); + return r; + } + static constexpr SkRect SK_WARN_UNUSED_RESULT MakeWH(SkScalar w, SkScalar h) { return SkRect{0, 0, w, h}; } |