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

Issue 2409583003: Apply linear gradient premul in 4f (Closed)

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

Description

Apply linear gradient premul in 4f (spotted by reed@) Instead of converting to SkPMColor first, apply the premul in 4f and then just store. A modified bench shows a significant speedup: 17/17 MB 1 690µs 695µs 695µs 700µs 0% █▅▁▄▆▅▁▅▆▃ 8888 gradient_linear_clamp_3color 17/17 MB 1 832µs 837µs 839µs 870µs 1% █▁▁▂▂▂▂▂▂▂ 8888 gradient_linear_clamp_hicolor 17/17 MB 1 651µs 659µs 665µs 701µs 3% ▆█▅▁▂▂▁▁▂▂ 8888 gradient_linear_clamp vs. 17/17 MB 1 1.03ms 1.03ms 1.04ms 1.08ms 2% ██▇▁▁▁▁▁▁▁ 8888 gradient_linear_clamp_3color 17/17 MB 1 1.17ms 1.18ms 1.18ms 1.22ms 1% █▄▂▁▁▁▁▁▁▁ 8888 gradient_linear_clamp_hicolor 17/17 MB 1 1.1ms 1.15ms 1.14ms 1.16ms 2% ▇▇▇▇▇▇██▁▁ 8888 gradient_linear_clamp R=reed@google.com,brianosman@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2409583003 Committed: https://skia.googlesource.com/skia/+/0ce4f230eb2e95523557bf6c6a195f51bc88163f

Patch Set 1 #

Total comments: 2

Patch Set 2 : deferred dithering #

Total comments: 3

Patch Set 3 : cleanup #

Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -16 lines) Patch
M src/effects/gradients/SkLinearGradient.cpp View 1 2 5 chunks +53 lines, -16 lines 0 comments Download

Messages

Total messages: 34 (19 generated)
f(malita)
I'll land a Chromium guard first. This is for the legacy 4f impl only, planning ...
4 years, 2 months ago (2016-10-10 18:11:52 UTC) #3
reed1
https://codereview.chromium.org/2409583003/diff/1/src/effects/gradients/SkLinearGradient.cpp File src/effects/gradients/SkLinearGradient.cpp (right): https://codereview.chromium.org/2409583003/diff/1/src/effects/gradients/SkLinearGradient.cpp#newcode543 src/effects/gradients/SkLinearGradient.cpp:543: c4f255 = Sk4f::Min(Sk4f::Max(x, Sk4f(0)), Sk4f(255)); does the store() call ...
4 years, 2 months ago (2016-10-10 18:20:18 UTC) #7
f(malita)
https://codereview.chromium.org/2409583003/diff/1/src/effects/gradients/SkLinearGradient.cpp File src/effects/gradients/SkLinearGradient.cpp (right): https://codereview.chromium.org/2409583003/diff/1/src/effects/gradients/SkLinearGradient.cpp#newcode543 src/effects/gradients/SkLinearGradient.cpp:543: c4f255 = Sk4f::Min(Sk4f::Max(x, Sk4f(0)), Sk4f(255)); On 2016/10/10 18:20:17, reed1 ...
4 years, 2 months ago (2016-10-10 18:33:18 UTC) #8
reed1
On 2016/10/10 18:33:18, f(malita) wrote: > https://codereview.chromium.org/2409583003/diff/1/src/effects/gradients/SkLinearGradient.cpp > File src/effects/gradients/SkLinearGradient.cpp (right): > > https://codereview.chromium.org/2409583003/diff/1/src/effects/gradients/SkLinearGradient.cpp#newcode543 > ...
4 years, 2 months ago (2016-10-10 18:48:51 UTC) #11
f(malita)
On 2016/10/10 18:48:51, reed1 wrote: > On 2016/10/10 18:33:18, f(malita) wrote: > > > https://codereview.chromium.org/2409583003/diff/1/src/effects/gradients/SkLinearGradient.cpp ...
4 years, 2 months ago (2016-10-10 19:22:24 UTC) #12
reed1
On 2016/10/10 19:22:24, f(malita) wrote: > On 2016/10/10 18:48:51, reed1 wrote: > > On 2016/10/10 ...
4 years, 2 months ago (2016-10-10 21:23:37 UTC) #13
f(malita)
It turns out it's not quite that hard to defer dithering when we need to ...
4 years, 2 months ago (2016-10-11 13:43:17 UTC) #14
reed1
wow, that seems very tricky, that at several call-sites we have to know to add ...
4 years, 2 months ago (2016-10-11 16:31:39 UTC) #19
mtklein
https://codereview.chromium.org/2409583003/diff/20001/src/effects/gradients/SkLinearGradient.cpp File src/effects/gradients/SkLinearGradient.cpp (right): https://codereview.chromium.org/2409583003/diff/20001/src/effects/gradients/SkLinearGradient.cpp#newcode543 src/effects/gradients/SkLinearGradient.cpp:543: const float scale = x[SkPM4f::A] * 1.f / 255; ...
4 years, 2 months ago (2016-10-11 16:38:15 UTC) #21
f(malita)
On 2016/10/11 16:31:39, reed1 wrote: > wow, that seems very tricky, that at several call-sites ...
4 years, 2 months ago (2016-10-11 19:19:07 UTC) #22
f(malita)
4 years, 2 months ago (2016-10-14 14:38:17 UTC) #27
f(malita)
4 years ago (2016-12-06 15:39:44 UTC) #28
reed1
lgtm
4 years ago (2016-12-06 15:58:13 UTC) #29
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/2409583003/40001
4 years ago (2016-12-06 16:17:59 UTC) #31
commit-bot: I haz the power
4 years ago (2016-12-06 16:57:52 UTC) #34
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://skia.googlesource.com/skia/+/0ce4f230eb2e95523557bf6c6a195f51bc88163f

Powered by Google App Engine
This is Rietveld 408576698