diff options
author | 2013-12-30 14:40:38 +0000 | |
---|---|---|
committer | 2013-12-30 14:40:38 +0000 | |
commit | 57212f9469c8056bab3c85243dbb904e386eab95 (patch) | |
tree | 403c9f2ab9d20ab35397ab2e9dd9e2e6a27a441f /src/core/SkRegion_path.cpp | |
parent | 4ad4ae907fa83773f671137b0e4e8c9525ab81cd (diff) |
Revert "Revert of https://codereview.chromium.org/113823003/"
This reverts commit 68b4b32066ea0ba9dbb5d326a836f8a54297b7aa.
BUG=
Review URL: https://codereview.chromium.org/122293002
git-svn-id: http://skia.googlecode.com/svn/trunk@12842 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkRegion_path.cpp')
-rw-r--r-- | src/core/SkRegion_path.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/core/SkRegion_path.cpp b/src/core/SkRegion_path.cpp index a20647c966..95247f403e 100644 --- a/src/core/SkRegion_path.cpp +++ b/src/core/SkRegion_path.cpp @@ -107,8 +107,6 @@ bool SkRgnBuilder::init(int maxHeight, int maxTransitions, bool pathIsInverse) { return false; } - Sk64 count, size; - if (pathIsInverse) { // allow for additional X transitions to "invert" each scanline // [ L' ... normal transitions ... R' ] @@ -117,25 +115,25 @@ bool SkRgnBuilder::init(int maxHeight, int maxTransitions, bool pathIsInverse) { } // compute the count with +1 and +3 slop for the working buffer - count.setMul(maxHeight + 1, 3 + maxTransitions); + int64_t count = sk_64_mul(maxHeight + 1, 3 + maxTransitions); if (pathIsInverse) { // allow for two "empty" rows for the top and bottom // [ Y, 1, L, R, S] == 5 (*2 for top and bottom) - count.add(10); + count += 10; } - if (!count.is32() || count.isNeg()) { + if (count < 0 || !sk_64_isS32(count)) { return false; } - fStorageCount = count.get32(); + fStorageCount = sk_64_asS32(count); - size.setMul(fStorageCount, sizeof(SkRegion::RunType)); - if (!size.is32() || size.isNeg()) { + int64_t size = sk_64_mul(fStorageCount, sizeof(SkRegion::RunType)); + if (size < 0 || !sk_64_isS32(size)) { return false; } - fStorage = (SkRegion::RunType*)sk_malloc_flags(size.get32(), 0); + fStorage = (SkRegion::RunType*)sk_malloc_flags(sk_64_asS32(size), 0); if (NULL == fStorage) { return false; } |