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

Unified Diff: src/effects/gradients/Sk4fGradientPriv.h

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/core/SkXfermode4f.cpp ('k') | src/effects/gradients/Sk4fLinearGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/Sk4fGradientPriv.h
diff --git a/src/effects/gradients/Sk4fGradientPriv.h b/src/effects/gradients/Sk4fGradientPriv.h
index 9745119fd4a23659adc8b60984d3da956dce5b5b..6542683eb0a47cdf8cada494a7adc98e5f94f268 100644
--- a/src/effects/gradients/Sk4fGradientPriv.h
+++ b/src/effects/gradients/Sk4fGradientPriv.h
@@ -109,18 +109,16 @@ struct DstTraits<DstType::S32, premul> {
using Type = SkPMColor;
static Sk4f load(const SkPM4f& c) {
- // Prescaling by (255^2, 255^2, 255^2, 255) on load, to avoid a 255 multiply on
- // each store (S32 conversion yields a uniform 255 factor).
- return c.to4f_pmorder() * Sk4f(255 * 255, 255 * 255, 255 * 255, 255);
+ return c.to4f_pmorder();
}
static void store(const Sk4f& c, Type* dst) {
// FIXME: this assumes opaque colors. Handle unpremultiplication.
- *dst = to_4b(linear_to_srgb(PM::apply(c)));
+ *dst = Sk4f_toS32(PM::apply(c));
}
static void store(const Sk4f& c, Type* dst, int n) {
- sk_memset32(dst, to_4b(linear_to_srgb(PM::apply(c))), n);
+ sk_memset32(dst, Sk4f_toS32(PM::apply(c)), n);
}
static void store4x(const Sk4f& c0, const Sk4f& c1,
« no previous file with comments | « src/core/SkXfermode4f.cpp ('k') | src/effects/gradients/Sk4fLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698