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

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

Issue 1756573002: [Reland] Fix SkTwoPointConicalGradient zero-radius handling (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: avoid all-zero radius instantiation Created 4 years, 10 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 | « no previous file | src/effects/gradients/SkTwoPointConicalGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkGradientShader.cpp
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 5444c1caadedbb1f7dc5bbfecf8378340a46ec16..985d45966b2bd5b5dafb8170fc9a73f07acf9be8 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -840,8 +840,10 @@ SkShader* SkGradientShader::CreateTwoPointConical(const SkPoint& start,
if (!valid_grad(colors, pos, colorCount, mode)) {
return nullptr;
}
- if (start == end && startRadius == endRadius) {
- return SkShader::CreateEmptyShader();
+ if (startRadius == endRadius) {
+ if (start == end || startRadius == 0) {
+ return SkShader::CreateEmptyShader();
+ }
}
EXPAND_1_COLOR(colorCount);
« no previous file with comments | « no previous file | src/effects/gradients/SkTwoPointConicalGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698