Revert[2] of expand unitests for color4f
This reverts commit 5f34e8ed82e6cbf29401bda5d423a50a2ab6db74.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1622983002
TBR=
Review URL: https://codereview.chromium.org/1622983002
diff --git a/src/core/SkColor.cpp b/src/core/SkColor.cpp
index c9f4a14..1794cd7 100644
--- a/src/core/SkColor.cpp
+++ b/src/core/SkColor.cpp
@@ -104,9 +104,10 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "SkNx.h"
-SkColor4f SkColor4f::Pin(float a, float r, float g, float b) {
- SkColor4f c4;
- Sk4f::Min(Sk4f::Max(Sk4f(a, r, g, b), Sk4f(0)), Sk4f(1)).store(c4.vec());
+SkPM4f SkPM4f::FromPMColor(SkPMColor c) {
+ Sk4f value = SkNx_cast<float>(Sk4b::Load((const uint8_t*)&c));
+ SkPM4f c4;
+ (value * Sk4f(1.0f / 255)).store(c4.fVec);
return c4;
}
@@ -117,6 +118,12 @@
return c4;
}
+SkColor4f SkColor4f::Pin(float a, float r, float g, float b) {
+ SkColor4f c4;
+ Sk4f::Min(Sk4f::Max(Sk4f(a, r, g, b), Sk4f(0)), Sk4f(1)).store(c4.vec());
+ return c4;
+}
+
SkPM4f SkColor4f::premul() const {
auto src = Sk4f::Load(this->pin().vec());
float srcAlpha = src.kth<0>(); // need the pinned version of our alpha