make pm4f be RGBA always, not pmcolor order
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1774523002
Review URL: https://codereview.chromium.org/1774523002
diff --git a/src/core/SkColor.cpp b/src/core/SkColor.cpp
index 497c328..ab63300 100644
--- a/src/core/SkColor.cpp
+++ b/src/core/SkColor.cpp
@@ -102,12 +102,11 @@
}
///////////////////////////////////////////////////////////////////////////////////////////////////
-#include "SkPM4f.h"
-#include "SkNx.h"
+#include "SkPM4fPriv.h"
#include "SkHalf.h"
SkPM4f SkPM4f::FromPMColor(SkPMColor c) {
- Sk4f value = SkNx_cast<float>(Sk4b::Load(&c));
+ Sk4f value = to_4f_rgba(c);
SkPM4f c4;
(value * Sk4f(1.0f / 255)).store(&c4);
return c4;
@@ -171,15 +170,8 @@
float srcAlpha = src[0]; // need the pinned version of our alpha
src = src * Sk4f(1, srcAlpha, srcAlpha, srcAlpha);
-#ifdef SK_PMCOLOR_IS_BGRA
- // ARGB -> BGRA
- Sk4f dst = SkNx_shuffle<3,2,1,0>(src);
-#else
// ARGB -> RGBA
Sk4f dst = SkNx_shuffle<1,2,3,0>(src);
-#endif
- SkPM4f pm4;
- dst.store(&pm4);
- return pm4;
+ return SkPM4f::From4f(dst);
}