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

Issue 2370063002: Gradients are serialized (and can be constructed) as SkColor4f + SkColorSpace (Closed)

Created:
4 years, 2 months ago by Brian Osman
Modified:
4 years, 2 months ago
Reviewers:
f(malita), reed1
CC:
reviews_skia.org
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Gradients are serialized (and can be constructed) as SkColor4f + SkColorSpace Added gradient shader factories that take SkColor4f + SkColorSpace. Modified Descriptor to only store SkColor4f + SkColorSpace. Existing factories make use of helper code to convert SkColor and forward to the new factories. Bumped SKP version to handle new gradient serialization format. I was toying with using half-float when serializing SkColor4f, despite my aggressive packing of flags, this format is significantly bigger. Also added GM to use 4f factories. This GM should (and does) look identical to the existing gradients GM. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2370063002 Committed: https://skia.googlesource.com/skia/+/e25d71ccbcdb47c7ee7bdf13235066092ae11af3

Patch Set 1 #

Patch Set 2 : Rewrote serialization #

Patch Set 3 : Tag SkColor constructed gradients as sRGB #

Patch Set 4 : Tweaks #

Patch Set 5 : Rebase #

Patch Set 6 : Bump SKP version #

Total comments: 5

Patch Set 7 : Add comment and static_assert #

Patch Set 8 : Better assert? #

Patch Set 9 : Widen storage for flags. Shift used bits to be contiguous. Document layout. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+489 lines, -142 lines) Patch
M gm/gradients.cpp View 8 chunks +137 lines, -11 lines 0 comments Download
M include/core/SkPicture.h View 1 2 3 4 5 6 2 chunks +5 lines, -1 line 0 comments Download
M include/effects/SkGradientShader.h View 4 chunks +88 lines, -0 lines 0 comments Download
M src/core/SkReadBuffer.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M src/effects/gradients/SkGradientShader.cpp View 1 2 3 4 5 6 7 8 15 chunks +243 lines, -118 lines 0 comments Download
M src/effects/gradients/SkGradientShaderPriv.h View 1 2 chunks +3 lines, -4 lines 0 comments Download
M src/effects/gradients/SkLinearGradient.cpp View 1 1 chunk +3 lines, -2 lines 0 comments Download
M src/effects/gradients/SkRadialGradient.cpp View 1 1 chunk +3 lines, -2 lines 0 comments Download
M src/effects/gradients/SkSweepGradient.cpp View 1 1 chunk +3 lines, -2 lines 0 comments Download
M src/effects/gradients/SkTwoPointConicalGradient.cpp View 1 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 26 (14 generated)
Brian Osman
This is a lot of typing. We could reduce that substantially if we made the ...
4 years, 2 months ago (2016-09-26 20:47:32 UTC) #3
Brian Osman
4 years, 2 months ago (2016-09-28 15:20:35 UTC) #7
reed1
api lgtm details in lineargradient I defer to florin
4 years, 2 months ago (2016-09-28 15:25:21 UTC) #8
f(malita)
lgtm https://codereview.chromium.org/2370063002/diff/100001/include/core/SkPicture.h File include/core/SkPicture.h (right): https://codereview.chromium.org/2370063002/diff/100001/include/core/SkPicture.h#newcode242 include/core/SkPicture.h:242: nit: static_assert(MIN_PICTURE_VERSION <= 48, "Remove legacy gradient deserialization ...
4 years, 2 months ago (2016-09-28 15:41:53 UTC) #9
Brian Osman
https://codereview.chromium.org/2370063002/diff/100001/include/core/SkPicture.h File include/core/SkPicture.h (right): https://codereview.chromium.org/2370063002/diff/100001/include/core/SkPicture.h#newcode242 include/core/SkPicture.h:242: On 2016/09/28 15:41:52, f(malita) wrote: > nit: static_assert(MIN_PICTURE_VERSION <= ...
4 years, 2 months ago (2016-09-28 15:46:17 UTC) #10
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/2370063002/120001
4 years, 2 months ago (2016-09-28 15:50:19 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-GN-Trybot on master.client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-GN-Trybot/builds/1560)
4 years, 2 months ago (2016-09-28 15:53:29 UTC) #15
f(malita)
https://codereview.chromium.org/2370063002/diff/100001/src/effects/gradients/SkGradientShader.cpp File src/effects/gradients/SkGradientShader.cpp (right): https://codereview.chromium.org/2370063002/diff/100001/src/effects/gradients/SkGradientShader.cpp#newcode16 src/effects/gradients/SkGradientShader.cpp:16: enum GradientSerializationFlags { On 2016/09/28 15:46:17, Brian Osman wrote: ...
4 years, 2 months ago (2016-09-28 15:54:46 UTC) #16
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/2370063002/140001
4 years, 2 months ago (2016-09-28 17:30:27 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-GN-Trybot on master.client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-GN-Trybot/builds/1566)
4 years, 2 months ago (2016-09-28 17:36:58 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/2370063002/160001
4 years, 2 months ago (2016-09-28 17:52:28 UTC) #24
commit-bot: I haz the power
4 years, 2 months ago (2016-09-28 18:27:31 UTC) #26
Message was sent while issue was closed.
Committed patchset #9 (id:160001) as
https://skia.googlesource.com/skia/+/e25d71ccbcdb47c7ee7bdf13235066092ae11af3

Powered by Google App Engine
This is Rietveld 408576698