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

Unified Diff: src/effects/SkColorMatrixFilter.cpp

Issue 1650653002: SkNx Load/store: take any pointer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify call sites Created 4 years, 11 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/core/SkScan_Hairline.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorMatrixFilter.cpp
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index 980412b8dd78ec2fffe398b9592cd2733856e4c6..10a4225994d10b30bb064cbbab38323744e85eb4 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -86,7 +86,7 @@ static Sk4f clamp_0_1(const Sk4f& x) {
static SkPMColor round(const Sk4f& x) {
SkPMColor c;
- SkNx_cast<uint8_t>(x * Sk4f(255) + Sk4f(0.5f)).store((uint8_t*)&c);
+ SkNx_cast<uint8_t>(x * Sk4f(255) + Sk4f(0.5f)).store(&c);
return c;
}
@@ -132,7 +132,7 @@ struct SkPMColorAdaptor {
return round(c4);
}
static Sk4f To4f(SkPMColor c) {
- return SkNx_cast<float>(Sk4b::Load((const uint8_t*)&c)) * Sk4f(1.0f/255);
+ return SkNx_cast<float>(Sk4b::Load(&c)) * Sk4f(1.0f/255);
}
};
void SkColorMatrixFilter::filterSpan(const SkPMColor src[], int count, SkPMColor dst[]) const {
@@ -142,11 +142,11 @@ void SkColorMatrixFilter::filterSpan(const SkPMColor src[], int count, SkPMColor
struct SkPM4fAdaptor {
static SkPM4f From4f(const Sk4f& c4) {
SkPM4f c;
- c4.store(c.fVec);
+ c4.store(&c);
return c;
}
static Sk4f To4f(const SkPM4f& c) {
- return Sk4f::Load(c.fVec);
+ return Sk4f::Load(&c);
}
};
void SkColorMatrixFilter::filterSpan4f(const SkPM4f src[], int count, SkPM4f dst[]) const {
« no previous file with comments | « src/core/SkScan_Hairline.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698