aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRectPriv.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkRectPriv.h')
-rw-r--r--src/core/SkRectPriv.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/SkRectPriv.h b/src/core/SkRectPriv.h
index 16c9535cc8..d2a2ce4665 100644
--- a/src/core/SkRectPriv.h
+++ b/src/core/SkRectPriv.h
@@ -9,6 +9,7 @@
#define SkRectPriv_DEFINED
#include "SkRect.h"
+#include "SkMathPriv.h"
class SkRectPriv {
public:
@@ -45,6 +46,12 @@ public:
r->fTop = SkMinScalar(pt.fY, r->fTop);
r->fBottom = SkMaxScalar(pt.fY, r->fBottom);
}
+
+ // conservative check. will return false for very large values that "could" fit
+ static bool FitsInFixed(const SkRect& r) {
+ return SkFitsInFixed(r.fLeft) && SkFitsInFixed(r.fTop) &&
+ SkFitsInFixed(r.fRight) && SkFitsInFixed(r.fBottom);
+ }
};