From 6f02af9b54c28294363b5bde1f9c103fe0f054bc Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Tue, 5 Jun 2018 15:11:11 -0400 Subject: remove linear-blended sRGB dst support in software This is the mechanism we'd want to add back if we add an sRGBA SkColorType. This will break the DM "srgb" config hard. Landing this first should help flush out GMs that are incidentally using sRGB offscreens. Updated tests/AnimatedImageTest.cpp to avoid linear sRGB 8888 surfaces. CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Change-Id: Idb5035cf4d60fcd1dc24c303d43a406fc4a603fa Reviewed-on: https://skia-review.googlesource.com/132261 Commit-Queue: Mike Klein Reviewed-by: Brian Osman --- src/opts/SkRasterPipeline_opts.h | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'src/opts') diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h index d6e0d4ba55..f7c757de46 100644 --- a/src/opts/SkRasterPipeline_opts.h +++ b/src/opts/SkRasterPipeline_opts.h @@ -1314,24 +1314,18 @@ STAGE(unpremul, Ctx::None) { STAGE(force_opaque , Ctx::None) { a = 1; } STAGE(force_opaque_dst, Ctx::None) { da = 1; } -SI F from_srgb_(F s) { - auto lo = s * (1/12.92f); - auto hi = mad(s*s, mad(s, 0.3000f, 0.6975f), 0.0025f); - return if_then_else(s < 0.055f, lo, hi); -} - STAGE(from_srgb, Ctx::None) { - r = from_srgb_(r); - g = from_srgb_(g); - b = from_srgb_(b); -} -STAGE(from_srgb_dst, Ctx::None) { - dr = from_srgb_(dr); - dg = from_srgb_(dg); - db = from_srgb_(db); + auto fn = [](F s) { + auto lo = s * (1/12.92f); + auto hi = mad(s*s, mad(s, 0.3000f, 0.6975f), 0.0025f); + return if_then_else(s < 0.055f, lo, hi); + }; + r = fn(r); + g = fn(g); + b = fn(b); } STAGE(to_srgb, Ctx::None) { - auto fn = [&](F l) { + auto fn = [](F l) { // We tweak c and d for each instruction set to make sure fn(1) is exactly 1. #if defined(JUMPER_IS_AVX512) const float c = 1.130026340485f, -- cgit v1.2.3