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

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

Issue 1770153002: Fix 4f gradient swizzle post http://crrev.com/1774523002 (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: float mult Created 4 years, 9 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.h ('k') | src/effects/gradients/Sk4fLinearGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/Sk4fGradientBase.cpp
diff --git a/src/effects/gradients/Sk4fGradientBase.cpp b/src/effects/gradients/Sk4fGradientBase.cpp
index bd3c51a0352cccdbce31a7afb514419b13a13644..76fb178776a5ce7c07245a113a257966fcf9aae7 100644
--- a/src/effects/gradients/Sk4fGradientBase.cpp
+++ b/src/effects/gradients/Sk4fGradientBase.cpp
@@ -28,24 +28,14 @@ Interval::Interval(SkPMColor c0, SkScalar p0,
, fZeroRamp(c0 == c1) {
SkASSERT(p0 != p1);
- const Sk4f c4f0 = SkNx_cast<float>(Sk4b::Load(&c0)) * componentScale;
- const Sk4f c4f1 = SkNx_cast<float>(Sk4b::Load(&c1)) * componentScale;
+ const Sk4f c4f0 = SkPM4f::FromPMColor(c0).to4f() * componentScale;
+ const Sk4f c4f1 = SkPM4f::FromPMColor(c1).to4f() * componentScale;
const Sk4f dc4f = (c4f1 - c4f0) / (p1 - p0);
c4f0.store(&fC0.fVec);
dc4f.store(&fDc.fVec);
}
-SkGradientShaderBase::GradientShaderBase4fContext::
-Interval::Interval(const Sk4f& c0, const Sk4f& dc,
- SkScalar p0, SkScalar p1)
- : fP0(p0)
- , fP1(p1)
- , fZeroRamp((dc == 0).allTrue()) {
- c0.store(fC0.fVec);
- dc.store(fDc.fVec);
-}
-
bool SkGradientShaderBase::GradientShaderBase4fContext::
Interval::contains(SkScalar fx) const {
return in_range(fx, fP0, fP1);
« no previous file with comments | « src/effects/gradients/Sk4fGradientBase.h ('k') | src/effects/gradients/Sk4fLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698