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

Unified Diff: src/core/SkFloatBits.cpp

Issue 373383003: ios fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove temp directory hack Created 6 years, 5 months 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
Index: src/core/SkFloatBits.cpp
diff --git a/src/core/SkFloatBits.cpp b/src/core/SkFloatBits.cpp
index 39b51abf1dc8a9939c41e69463ee50a37b9b1956..5fad36122233b3dd5a6e5b86624f8a9679ebdbc7 100644
--- a/src/core/SkFloatBits.cpp
+++ b/src/core/SkFloatBits.cpp
@@ -85,7 +85,11 @@ int32_t SkFloatBits_toIntFloor(int32_t packed) {
value = SkApplySign(value, SkExtractSign(packed));
exp = -exp;
if (exp > 25) { // underflow
+#ifdef SK_BUILD_FOR_IOS
+ if (exp > 149) return 0;
reed1 2014/07/10 18:39:39 Can we perhaps encapsulate this in a helper functi
caryclark 2014/07/10 21:07:03 I commented and gave it a platform independent #de
+#else
exp = 25;
+#endif
}
// int add = 0;
return value >> exp;
@@ -145,7 +149,12 @@ int32_t SkFloatBits_toIntCeil(int32_t packed) {
value = SkApplySign(value, SkExtractSign(packed));
exp = -exp;
if (exp > 25) { // underflow
+#ifdef SK_BUILD_FOR_IOS
+ if (exp > 149) return 0;
+ return 0 < value;
+#else
exp = 25;
+#endif
}
int add = (1 << exp) - 1;
return (value + add) >> exp;
« no previous file with comments | « include/core/SkImageEncoder.h ('k') | src/core/SkPoint.cpp » ('j') | src/core/SkPoint.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698