From 591971d02a8e22dac0955c0f07b7cf500a89d5cc Mon Sep 17 00:00:00 2001 From: msarett Date: Wed, 14 Sep 2016 10:23:03 -0700 Subject: [PATCH] Convert back to 0-255 scale before storing linear bytes TBR=mtklein@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2338203005 Review-Url: https://codereview.chromium.org/2338203005 --- src/core/SkColorSpaceXform.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/SkColorSpaceXform.cpp b/src/core/SkColorSpaceXform.cpp index 5a6f015..de7cf85 100644 --- a/src/core/SkColorSpaceXform.cpp +++ b/src/core/SkColorSpaceXform.cpp @@ -857,9 +857,9 @@ static inline void store_linear(void* dst, const uint32_t* src, kRShift = 16; } - dr = sk_clamp_0_255(dr); - dg = sk_clamp_0_255(dg); - db = sk_clamp_0_255(db); + dr = sk_clamp_0_255(255.0f * dr); + dg = sk_clamp_0_255(255.0f * dg); + db = sk_clamp_0_255(255.0f * db); Sk4i da = Sk4i::Load(src) & 0xFF000000; @@ -874,7 +874,7 @@ template static inline void store_linear_1(void* dst, const uint32_t* src, Sk4f& rgba, const Sk4f&, const uint8_t* const[3]) { - rgba = sk_clamp_0_255(rgba); + rgba = sk_clamp_0_255(255.0f * rgba); uint32_t tmp; SkNx_cast(Sk4f_round(rgba)).store(&tmp); -- 2.7.4