From: reed@google.com Date: Tue, 28 Feb 2012 16:34:29 +0000 (+0000) Subject: handle checking for large bounds correctly when SkScalar is fixed X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~16763 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d76dafb261629ab425dac89a4fafee19281b1e7e;p=platform%2Fupstream%2FlibSkiaSharp.git 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 --- diff --git a/src/core/SkScan_AntiPath.cpp b/src/core/SkScan_AntiPath.cpp index 9d05d32..e80ad3e 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;