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

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

Issue 2441733002: [Sk4fGradient] Use infinity floats for clamp-mode extreme positions (Closed)
Patch Set: vertical case fix Created 4 years, 2 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 | « src/effects/gradients/Sk4fGradientBase.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « src/effects/gradients/Sk4fGradientBase.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698