diff options
Diffstat (limited to 'src/core/SkPM4fPriv.h')
-rw-r--r-- | src/core/SkPM4fPriv.h | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/core/SkPM4fPriv.h b/src/core/SkPM4fPriv.h index f5e9aa02e6..4a288feb98 100644 --- a/src/core/SkPM4fPriv.h +++ b/src/core/SkPM4fPriv.h @@ -53,25 +53,16 @@ static inline SkPM4f premul_in_dst_colorspace(SkColor4f color4f, return {{color4f.fR, color4f.fG, color4f.fB, color4f.fA}}; } -static inline SkPM4f premul_in_dst_colorspace(SkColor c, SkColorSpace* dstCS) { - SkColor4f color4f; - swizzle_rb(Sk4f_fromL32(c)).store(color4f.vec()); - +static inline SkPM4f premul_in_dst_colorspace(SkColor color, SkColorSpace* dstCS) { // SkColors are always sRGB. - return premul_in_dst_colorspace(color4f, SkColorSpace::MakeSRGB().get(), dstCS); + return premul_in_dst_colorspace(SkColor4f::FromColor(color), + SkColorSpace::MakeSRGB().get(), dstCS); } // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // Functions below this line are probably totally broken as far as color space management goes. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -static inline Sk4f Sk4f_fromS32(uint32_t px) { - return { sk_linear_from_srgb[(px >> 0) & 0xff], - sk_linear_from_srgb[(px >> 8) & 0xff], - sk_linear_from_srgb[(px >> 16) & 0xff], - (1/255.0f) * (px >> 24) }; -} - static inline uint32_t Sk4f_toS32(const Sk4f& px) { Sk4i rgb = sk_linear_to_srgb(px), srgb = { rgb[0], rgb[1], rgb[2], (int)(255.0f * px[3] + 0.5f) }; |