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

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

Issue 1471753004: Take span len into account when determining whether gradient is vertical (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/SkLinearGradient.cpp
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index bfa473c0123eefa1d2831953513eff65700bf8b8..f47b6ab30e7fa81392abd02afe9a5a89f38d687c 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -896,7 +896,7 @@ void SkLinearGradient::LinearGradientContext::shade4_clamp(int x, int y, SkPMCol
const float dither[2] = { dither0, dither1 };
const float invDx = 1 / dx;
- if (SkScalarNearlyZero(dx)) { // gradient is vertical
+ if (SkScalarNearlyZero(dx * count)) { // gradient is vertical
const float pinFx = SkTPin(fx, 0.0f, 1.0f);
Sk4f c = lerp_color(pinFx, find_forward(fRecs.begin(), pinFx));
if (fApplyAlphaAfterInterp) {
« 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