SkNx Load/store: take any pointer.
This means we can remove a lot of explicit casts in code that uses SkNx.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1650653002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
Review URL: https://codereview.chromium.org/1650653002
diff --git a/src/core/SkColor.cpp b/src/core/SkColor.cpp
index cf6e0b2..865fe0d 100644
--- a/src/core/SkColor.cpp
+++ b/src/core/SkColor.cpp
@@ -105,16 +105,16 @@
#include "SkNx.h"
SkPM4f SkPM4f::FromPMColor(SkPMColor c) {
- Sk4f value = SkNx_cast<float>(Sk4b::Load((const uint8_t*)&c));
+ Sk4f value = SkNx_cast<float>(Sk4b::Load(&c));
SkPM4f c4;
- (value * Sk4f(1.0f / 255)).store(c4.fVec);
+ (value * Sk4f(1.0f / 255)).store(&c4);
return c4;
}
SkColor4f SkColor4f::FromColor(SkColor c) {
- Sk4f value = SkNx_shuffle<3,2,1,0>(SkNx_cast<float>(Sk4b::Load((const uint8_t*)&c)));
+ Sk4f value = SkNx_shuffle<3,2,1,0>(SkNx_cast<float>(Sk4b::Load(&c)));
SkColor4f c4;
- (value * Sk4f(1.0f / 255)).store(c4.vec());
+ (value * Sk4f(1.0f / 255)).store(&c4);
return c4;
}
@@ -138,7 +138,7 @@
#endif
SkPM4f pm4;
- dst.store(pm4.fVec);
+ dst.store(&pm4);
return pm4;
}