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

Unified Diff: include/core/SkScalar.h

Issue 809443002: Rewrite NaN checks in terms of SkScalarIsNaN() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « include/core/SkRect.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkScalar.h
diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h
index e0490e2b0beebc9b4b41bb32ff9b4542bb55918b..94c3ce15c04e20d8e7808be4a3b48caef6a53d47 100644
--- a/include/core/SkScalar.h
+++ b/include/core/SkScalar.h
@@ -127,7 +127,7 @@ static inline bool SkScalarIsFinite(SkScalar x) {
SkScalar prod = x * 0;
// At this point, prod will either be NaN or 0
// Therefore we can return (prod == prod) or (0 == prod).
- return prod == prod;
+ return !SkScalarIsNaN(prod);
}
/**
« no previous file with comments | « include/core/SkRect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698