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

Unified Diff: src/effects/gradients/SkLinearGradient.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/effects/SkColorMatrixFilter.cpp ('k') | src/opts/SkColorCubeFilter_opts.h » ('j') | 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 8c74427bac152705750eaae05b9d29b05950522f..4a27a35de47f79a81062517d9058525247cffe77 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -133,7 +133,7 @@ SkLinearGradient::LinearGradientContext::LinearGradientContext(
const Sk4f scale(1, 1, 1, paintAlpha);
for (int i = 0; i < count; ++i) {
uint32_t c = SkSwizzle_Color_to_PMColor(shader.fOrigColors[i]);
- rec[i].fColor = SkNx_cast<float>(Sk4b::Load((const uint8_t*)&c)) * scale;
+ rec[i].fColor = SkNx_cast<float>(Sk4b::Load(&c)) * scale;
if (i > 0) {
SkASSERT(rec[i - 1].fPos <= rec[i].fPos);
}
@@ -145,7 +145,7 @@ SkLinearGradient::LinearGradientContext::LinearGradientContext(
for (int i = 0; i < count; ++i) {
SkPMColor pmc = SkPreMultiplyColor(shader.fOrigColors[i]);
pmc = SkAlphaMulQ(pmc, alphaScale);
- rec[i].fColor = SkNx_cast<float>(Sk4b::Load((const uint8_t*)&pmc));
+ rec[i].fColor = SkNx_cast<float>(Sk4b::Load(&pmc));
if (i > 0) {
SkASSERT(rec[i - 1].fPos <= rec[i].fPos);
}
@@ -515,7 +515,7 @@ find_backward(const SkLinearGradient::LinearGradientContext::Rec rec[], float ti
template <bool apply_alpha> SkPMColor trunc_from_255(const Sk4f& x) {
SkPMColor c;
- SkNx_cast<uint8_t>(x).store((uint8_t*)&c);
+ SkNx_cast<uint8_t>(x).store(&c);
if (apply_alpha) {
c = SkPreMultiplyARGB(SkGetPackedA32(c), SkGetPackedR32(c),
SkGetPackedG32(c), SkGetPackedB32(c));
« no previous file with comments | « src/effects/SkColorMatrixFilter.cpp ('k') | src/opts/SkColorCubeFilter_opts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698