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

Issue 2337313002: (Some) gradients are gamma and gamut correct on GPU (Closed)

Created:
4 years, 3 months ago by Brian Osman
Modified:
4 years, 3 months ago
CC:
reviews_skia.org
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Add storage and computation of SkColor4f version of gradient stops. For now, we still only have the SkColor factory, but the Descriptor can now carry either an SkColor or SkColor4f specified gradient. Base class constructor automatically populates both forms of color, so that legacy raster backend will continue to work, and new backend work can operate directly from the float4 version. On the GPU side, we have similar logic, but GrGradientEffect only keeps one version of colors around: SkColor if the destination is legacy, and SkColor4f (with an optional gamut xform) if the destination is gamma correct. The 4f colors are already linear, and we gamut xform them in setData, so gradients are now fully color-correct in sRGB and F16 modes... ... unless there are more than three stops. Then we use a texture, and that code path isn't handled yet. We have a few choices here (do we use an 8-bit sRGB atlas, or just always use F16 linear atlas so we can share it among both sRGB and wide-gamut rendering). In any case, I'd like to defer that to a second CL. This change does fix the non-texture gradients in the gamut GM. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2337313002 Committed: https://skia.googlesource.com/skia/+/b9c5137a1cedbe8a3641db0b7c081881a2d5d58c

Patch Set 1 #

Patch Set 2 : Non-texture gradients are working! #

Patch Set 3 : Rebase #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+192 lines, -28 lines) Patch
M include/gpu/GrColorSpaceXform.h View 1 2 chunks +3 lines, -1 line 0 comments Download
M src/effects/gradients/SkGradientShader.cpp View 1 2 12 chunks +122 lines, -11 lines 0 comments Download
M src/effects/gradients/SkGradientShaderPriv.h View 1 2 8 chunks +36 lines, -11 lines 3 comments Download
M src/effects/gradients/SkLinearGradient.cpp View 1 2 2 chunks +5 lines, -1 line 0 comments Download
M src/effects/gradients/SkRadialGradient.cpp View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M src/effects/gradients/SkSweepGradient.cpp View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M src/effects/gradients/SkTwoPointConicalGradient.cpp View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M src/gpu/GrColorSpaceXform.cpp View 1 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (15 generated)
Brian Osman
4 years, 3 months ago (2016-09-14 18:43:16 UTC) #8
reed1
https://codereview.chromium.org/2337313002/diff/40001/src/effects/gradients/SkGradientShaderPriv.h File src/effects/gradients/SkGradientShaderPriv.h (right): https://codereview.chromium.org/2337313002/diff/40001/src/effects/gradients/SkGradientShaderPriv.h#newcode430 src/effects/gradients/SkGradientShaderPriv.h:430: // fColors4f and fColorSpaceXform will be populated. not specific ...
4 years, 3 months ago (2016-09-14 19:03:53 UTC) #9
Brian Osman
https://codereview.chromium.org/2337313002/diff/40001/src/effects/gradients/SkGradientShaderPriv.h File src/effects/gradients/SkGradientShaderPriv.h (right): https://codereview.chromium.org/2337313002/diff/40001/src/effects/gradients/SkGradientShaderPriv.h#newcode430 src/effects/gradients/SkGradientShaderPriv.h:430: // fColors4f and fColorSpaceXform will be populated. On 2016/09/14 ...
4 years, 3 months ago (2016-09-14 20:30:20 UTC) #10
f(malita)
https://codereview.chromium.org/2337313002/diff/40001/src/effects/gradients/SkGradientShaderPriv.h File src/effects/gradients/SkGradientShaderPriv.h (right): https://codereview.chromium.org/2337313002/diff/40001/src/effects/gradients/SkGradientShaderPriv.h#newcode87 src/effects/gradients/SkGradientShaderPriv.h:87: const SkColor* fColors; Could we drop fColors from Descriptor? ...
4 years, 3 months ago (2016-09-14 23:32:23 UTC) #15
Brian Osman
On 2016/09/14 23:32:23, f(malita) wrote: > https://codereview.chromium.org/2337313002/diff/40001/src/effects/gradients/SkGradientShaderPriv.h > File src/effects/gradients/SkGradientShaderPriv.h (right): > > https://codereview.chromium.org/2337313002/diff/40001/src/effects/gradients/SkGradientShaderPriv.h#newcode87 > ...
4 years, 3 months ago (2016-09-15 14:37:06 UTC) #16
f(malita)
On 2016/09/15 14:37:06, Brian Osman wrote: > On 2016/09/14 23:32:23, f(malita) wrote: > > > ...
4 years, 3 months ago (2016-09-15 15:28:54 UTC) #17
Brian Osman
Just waiting for GPU approval. Adding another set of GPU eyes. ;)
4 years, 3 months ago (2016-09-15 17:05:21 UTC) #20
bsalomon
On 2016/09/15 17:05:21, Brian Osman wrote: > Just waiting for GPU approval. Adding another set ...
4 years, 3 months ago (2016-09-15 17:52:21 UTC) #21
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/2337313002/40001
4 years, 3 months ago (2016-09-15 18:08:33 UTC) #23
commit-bot: I haz the power
4 years, 3 months ago (2016-09-15 18:09:48 UTC) #25
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://skia.googlesource.com/skia/+/b9c5137a1cedbe8a3641db0b7c081881a2d5d58c

Powered by Google App Engine
This is Rietveld 408576698