Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: src/core/SkRegion_path.cpp

Issue 122283002: Revert of remove Sk64 from public API, and start to remove usage internally (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkMipMap.cpp ('k') | src/images/SkImageDecoder_libwebp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRegion_path.cpp
diff --git a/src/core/SkRegion_path.cpp b/src/core/SkRegion_path.cpp
index 95247f403e8db29f81e93398c10e8c1b617758c6..a20647c9663da3f6f53e3d99cd3217a4d8e6d7c9 100644
--- a/src/core/SkRegion_path.cpp
+++ b/src/core/SkRegion_path.cpp
@@ -107,6 +107,8 @@
return false;
}
+ Sk64 count, size;
+
if (pathIsInverse) {
// allow for additional X transitions to "invert" each scanline
// [ L' ... normal transitions ... R' ]
@@ -115,25 +117,25 @@
}
// compute the count with +1 and +3 slop for the working buffer
- int64_t count = sk_64_mul(maxHeight + 1, 3 + maxTransitions);
+ count.setMul(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 += 10;
- }
-
- if (count < 0 || !sk_64_isS32(count)) {
+ count.add(10);
+ }
+
+ if (!count.is32() || count.isNeg()) {
return false;
}
- fStorageCount = sk_64_asS32(count);
-
- int64_t size = sk_64_mul(fStorageCount, sizeof(SkRegion::RunType));
- if (size < 0 || !sk_64_isS32(size)) {
+ fStorageCount = count.get32();
+
+ size.setMul(fStorageCount, sizeof(SkRegion::RunType));
+ if (!size.is32() || size.isNeg()) {
return false;
}
- fStorage = (SkRegion::RunType*)sk_malloc_flags(sk_64_asS32(size), 0);
+ fStorage = (SkRegion::RunType*)sk_malloc_flags(size.get32(), 0);
if (NULL == fStorage) {
return false;
}
« no previous file with comments | « src/core/SkMipMap.cpp ('k') | src/images/SkImageDecoder_libwebp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698