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

Unified Diff: include/core/SkScalar.h

Issue 2198263002: Image filters: force near-zero floating point parameters to zero. Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
« no previous file with comments | « include/core/SkPoint3.h ('k') | src/core/SkPoint3.cpp » ('j') | 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 922840fd1af52bb90f43a00e920e9cc008e00da7..806829c681d7234f95f0bf2e18bb1758bea89303 100644
--- a/include/core/SkScalar.h
+++ b/include/core/SkScalar.h
@@ -228,6 +228,11 @@ static inline bool SkScalarNearlyEqual(SkScalar x, SkScalar y,
return SkScalarAbs(x-y) <= tolerance;
}
+static inline SkScalar SkScalarNormalize(SkScalar x)
reed1 2016/08/26 17:49:43 Given this name, should it trigger only when x is
+{
+ return SkScalarNearlyZero(x) ? 0 : x;
+}
+
/** Linearly interpolate between A and B, based on t.
If t is 0, return A
If t is 1, return B
« no previous file with comments | « include/core/SkPoint3.h ('k') | src/core/SkPoint3.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698