Index: src/effects/gradients/Sk4fLinearGradient.cpp |
diff --git a/src/effects/gradients/Sk4fLinearGradient.cpp b/src/effects/gradients/Sk4fLinearGradient.cpp |
index 6d5e5dde9672f3efdc24ddd864a9846b7d06d804..ebfd13812e0c7eaf30199323b9a95dc3434e14ad 100644 |
--- a/src/effects/gradients/Sk4fLinearGradient.cpp |
+++ b/src/effects/gradients/Sk4fLinearGradient.cpp |
@@ -322,11 +322,16 @@ public: |
private: |
void compute_interval_props(SkScalar t) { |
- const Sk4f dC = DstTraits<dstType, premul>::load(fInterval->fDc); |
- fCc = DstTraits<dstType, premul>::load(fInterval->fC0); |
- fCc = fCc + dC * Sk4f(t); |
- fDcDx = dC * fDx; |
fZeroRamp = fIsVertical || fInterval->isZeroRamp(); |
+ fCc = DstTraits<dstType, premul>::load(fInterval->fC0); |
+ |
+ if (fInterval->isZeroRamp()) { |
+ fDcDx = 0; |
+ } else { |
+ const Sk4f dC = DstTraits<dstType, premul>::load(fInterval->fDc); |
+ fCc = fCc + dC * Sk4f(t); |
+ fDcDx = dC * fDx; |
+ } |
} |
const Interval* next_interval(const Interval* i) const { |