Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(972)

Unified Diff: src/effects/gradients/Sk4fLinearGradient.cpp

Issue 2163683002: Correct sRGB <-> linear everywhere. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: back to brute Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/gradients/Sk4fGradientPriv.h ('k') | src/opts/SkBlend_opts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/Sk4fLinearGradient.cpp
diff --git a/src/effects/gradients/Sk4fLinearGradient.cpp b/src/effects/gradients/Sk4fLinearGradient.cpp
index d22dbff8a170aa797e239a93582200b534eb7f38..dc6e530a0c0896777c185b0ab2a1ff5c5be4cefb 100644
--- a/src/effects/gradients/Sk4fLinearGradient.cpp
+++ b/src/effects/gradients/Sk4fLinearGradient.cpp
@@ -53,13 +53,10 @@ void ramp<DstType::S32, ApplyPremul::False>(const Sk4f& c, const Sk4f& dc, SkPMC
Sk4x4f c4x = Sk4x4f::Transpose(c, c + dc, c + dc * 2, c + dc * 3);
while (n >= 4) {
- const Sk4x4f cx4s32 = {
- c4x.r.rsqrt().invert(),
- c4x.g.rsqrt().invert(),
- c4x.b.rsqrt().invert(),
- c4x.a
- };
- cx4s32.transpose((uint8_t*)dst);
+ ( sk_linear_to_srgb(c4x.r) << 0
+ | sk_linear_to_srgb(c4x.g) << 8
+ | sk_linear_to_srgb(c4x.b) << 16
+ | Sk4f_round(255.0f*c4x.a) << 24).store(dst);
c4x.r += dc4x.r;
c4x.g += dc4x.g;
« no previous file with comments | « src/effects/gradients/Sk4fGradientPriv.h ('k') | src/opts/SkBlend_opts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698