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

Issue 2163683002: Correct sRGB <-> linear everywhere. (Closed)

Created:
4 years, 5 months ago by mtklein_C
Modified:
4 years, 5 months ago
Reviewers:
herb_g, f(malita), mtklein
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Correct sRGB <-> linear everywhere. This trims the SkPM4fPriv methods down to just foolproof methods. (Anything trying to build these itself is probably wrong.) Things like Sk4f srgb_to_linear(Sk4f) can't really exist anymore, at least not efficiently, so this refactor is somewhat more invasive than you might think. Generally this means things using to_4f() are also making a misstep... that's gone too. It also does not make sense to try to play games with linear floats with 255 bias any more. That hack can't work with real sRGB coding. Rather than update them, I've removed a couple of L32 xfermode fast paths. I'd even rather drop it entirely... BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2163683002 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Committed: https://skia.googlesource.com/skia/+/0c902473d64ef935a64d078f70bdc9334ab51427

Patch Set 1 #

Patch Set 2 : more #

Patch Set 3 : xfermode4f #

Patch Set 4 : update #

Patch Set 5 : add back exact_srgb_to_linear #

Patch Set 6 : declamp #

Patch Set 7 : update test+bench #

Patch Set 8 : remove pre-scale #

Patch Set 9 : Fix! #

Total comments: 2

Patch Set 10 : rebase #

Patch Set 11 : back to brute #

Unified diffs Side-by-side diffs Delta from patch set Stats (+159 lines, -282 lines) Patch
M bench/SkBlend_optsBench.cpp View 1 2 3 4 5 6 3 chunks +31 lines, -17 lines 0 comments Download
M src/core/SkColor.cpp View 2 chunks +6 lines, -16 lines 0 comments Download
M src/core/SkColorMatrixFilterRowMajor255.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkLinearBitmapPipeline_sample.h View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -5 lines 0 comments Download
M src/core/SkPM4fPriv.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +34 lines, -111 lines 0 comments Download
M src/core/SkSpanProcs.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/core/SkXfermode4f.cpp View 1 2 3 4 5 6 7 8 9 10 7 chunks +52 lines, -105 lines 0 comments Download
M src/effects/gradients/Sk4fGradientPriv.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -5 lines 0 comments Download
M src/effects/gradients/Sk4fLinearGradient.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -7 lines 0 comments Download
M src/opts/SkBlend_opts.h View 4 chunks +14 lines, -12 lines 0 comments Download
M tests/SkBlend_optsTest.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -1 line 0 comments Download

Messages

Total messages: 30 (22 generated)
mtklein_C
Caveat: gradients are totally busted.
4 years, 5 months ago (2016-07-19 20:53:40 UTC) #6
mtklein_C
4 years, 5 months ago (2016-07-19 21:09:26 UTC) #8
f(malita)
lgtm https://codereview.chromium.org/2163683002/diff/160001/src/opts/SkBlend_opts.h File src/opts/SkBlend_opts.h (right): https://codereview.chromium.org/2163683002/diff/160001/src/opts/SkBlend_opts.h#newcode31 src/opts/SkBlend_opts.h:31: *dst = Sk4f_toS32(s + d * (1.0f - ...
4 years, 5 months ago (2016-07-20 13:39:27 UTC) #10
mtklein
https://codereview.chromium.org/2163683002/diff/160001/src/opts/SkBlend_opts.h File src/opts/SkBlend_opts.h (right): https://codereview.chromium.org/2163683002/diff/160001/src/opts/SkBlend_opts.h#newcode31 src/opts/SkBlend_opts.h:31: *dst = Sk4f_toS32(s + d * (1.0f - s[3])); ...
4 years, 5 months ago (2016-07-20 14:03:29 UTC) #12
herb_g
lgtm
4 years, 5 months ago (2016-07-20 16:48:30 UTC) #13
commit-bot: I haz the power
COMMIT=false detected. CQ is abandoning the patch.
4 years, 5 months ago (2016-07-21 00:55:01 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2163683002/200001
4 years, 5 months ago (2016-07-21 01:08:52 UTC) #28
commit-bot: I haz the power
4 years, 5 months ago (2016-07-21 01:10:12 UTC) #30
Message was sent while issue was closed.
Committed patchset #11 (id:200001) as
https://skia.googlesource.com/skia/+/0c902473d64ef935a64d078f70bdc9334ab51427

Powered by Google App Engine
This is Rietveld 408576698