handle checking for large bounds correctly when SkScalar is fixed
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 28 Feb 2012 16:34:29 +0000 (16:34 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 28 Feb 2012 16:34:29 +0000 (16:34 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@3274 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkScan_AntiPath.cpp

index 9d05d32..e80ad3e 100644 (file)
@@ -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;