aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-02-28 16:34:29 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-02-28 16:34:29 +0000
commitd76dafb261629ab425dac89a4fafee19281b1e7e (patch)
treeb85638e400d26a15f2b672bf9f8e4d62e275927c /src/core
parent98a5b420aa41b02a4fbf77eaa378e039defc62bb (diff)
handle checking for large bounds correctly when SkScalar is fixed
git-svn-id: http://skia.googlecode.com/svn/trunk@3274 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkScan_AntiPath.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/SkScan_AntiPath.cpp b/src/core/SkScan_AntiPath.cpp
index 9d05d32bc7..e80ad3e073 100644
--- a/src/core/SkScan_AntiPath.cpp
+++ b/src/core/SkScan_AntiPath.cpp
@@ -580,7 +580,13 @@ static bool fitsInsideLimit(const SkRect& r, SkScalar max) {
}
static bool safeRoundOut(const SkRect& src, SkIRect* dst, int32_t maxInt) {
+#ifdef SK_SCALAR_IS_FIXED
+ // the max-int (shifted) is exactly what we want to compare against, to know
+ // if we can survive shifting our fixed-point coordinates
+ const SkFixed maxScalar = maxInt;
+#else
const SkScalar maxScalar = SkIntToScalar(maxInt);
+#endif
if (fitsInsideLimit(src, maxScalar)) {
src.roundOut(dst);
return true;