aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar fmalita <fmalita@chromium.org>2016-03-01 14:28:27 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-01 14:28:27 -0800
commit9c0b02a557e9be663a0eb07519e1b6a61a6c3df2 (patch)
tree354f82a2f7e13030b425455efa8845d72af311ee /src
parentbdc6b2b1689d3c88d6821f8c2faa2ec7660b9fba (diff)
Fix SkTwoPointConicalGradient zero-radius handling
r == 0 is within valid gradient range, we shouldn't skip it. BUG=skia:5023 R=caryclark@google.com,reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1756573002 Review URL: https://codereview.chromium.org/1756573002
Diffstat (limited to 'src')
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index b938ebdec7..2209306fe3 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -122,10 +122,10 @@ SkFixed TwoPtRadialContext::nextT() {
// find_quad_roots returns the values sorted, so we start with the last
float t = roots[countRoots - 1];
float r = lerp(fRec.fRadius, fRec.fDRadius, t);
- if (r <= 0) {
+ if (r < 0) {
t = roots[0]; // might be the same as roots[countRoots-1]
r = lerp(fRec.fRadius, fRec.fDRadius, t);
- if (r <= 0) {
+ if (r < 0) {
return TwoPtRadial::kDontDrawT;
}
}