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

Unified Diff: src/effects/gradients/SkSweepGradient.cpp

Issue 1506913002: Pin result in SkATan2_255 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Take 2 Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkSweepGradient.cpp
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index 24e86d023d78f0b01a7061129632a840a2e36ed7..4c5935158de985a781e459bb87a622458be80955 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -63,6 +63,9 @@ static unsigned SkATan2_255(float y, float x) {
static const float g255Over2PI = 40.584510488433314f;
float result = sk_float_atan2(y, x);
+ if (!SkScalarIsFinite(result)) {
+ return 0;
+ }
if (result < 0) {
result += 2 * SK_ScalarPI;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698