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

Issue 1214443002: Color dodge and burn with SkPMFloat. (Closed)

Created:
5 years, 6 months ago by mtklein_C
Modified:
5 years, 6 months ago
Reviewers:
mtklein, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Color dodge and burn with SkPMFloat. Both 25-35% faster with SSE. With NEON, Burn measures as a ~10% regression, Dodge a huge 2.9x improvement. The Burn regression is somewhat artificial: we're drawing random colored rects onto an opaque white dst, so we're heavily biased toward the (d==da) fast path in the serial code. In the vector code there's no short-circuiting and we always pay a fixed cost for ColorBurn regardless of src or dst content. Dodge's fast paths, in contrast, only trigger when (s==sa) or (d==0), neither of which happens any more than randomly in our benchmark. I don't think (d==0) should happen at all. Similarly, the (s==0) Burn fast path is really only going to happen as often as SkRandom allows. In practice, the existing Burn benchmark is hitting its fast path 100% of the time. So I actually feel really great that this only dings the benchmark by 10%. Chrome's still guarded by SK_SUPPORT_LEGACY_XFERMODES, which I'll lift after finishing the last xfermode, SoftLight. BUG=skia: Committed: https://skia.googlesource.com/skia/+/2aab22a58a366df4752c1cf0f004092c6e7be335

Patch Set 1 #

Patch Set 2 : NEON. Burn is a small regression, Dodge a huge improvement. #

Patch Set 3 : alphas(). 41/39 + 231/241 #

Total comments: 1

Patch Set 4 : tweaks #

Total comments: 3

Patch Set 5 : reed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -4 lines) Patch
M src/core/Sk4pxXfermode.h View 1 2 3 4 4 chunks +74 lines, -1 line 0 comments Download
M src/core/SkPMFloat.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/opts/SkNx_neon.h View 1 1 chunk +7 lines, -0 lines 0 comments Download
M src/opts/SkNx_sse.h View 1 chunk +5 lines, -0 lines 0 comments Download
M src/opts/SkPMFloat_neon.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M src/opts/SkPMFloat_none.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M src/opts/SkPMFloat_sse.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M src/opts/SkXfermode_opts_SSE2.cpp View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 15 (7 generated)
mtklein
https://codereview.chromium.org/1214443002/diff/40001/src/core/SkPMFloat.h File src/core/SkPMFloat.h (right): https://codereview.chromium.org/1214443002/diff/40001/src/core/SkPMFloat.h#newcode30 src/core/SkPMFloat.h:30: Sk4f alphas() const; // argb -> aaaa , generally ...
5 years, 6 months ago (2015-06-26 00:43:41 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1214443002/60001
5 years, 6 months ago (2015-06-26 15:20:03 UTC) #4
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 6 months ago (2015-06-26 15:48:38 UTC) #6
mtklein_C
5 years, 6 months ago (2015-06-26 16:01:43 UTC) #8
reed1
lgtm w/ nits https://codereview.chromium.org/1214443002/diff/60001/src/core/Sk4pxXfermode.h File src/core/Sk4pxXfermode.h (right): https://codereview.chromium.org/1214443002/diff/60001/src/core/Sk4pxXfermode.h#newcode113 src/core/Sk4pxXfermode.h:113: auto sa = s.alphas(), in general, ...
5 years, 6 months ago (2015-06-26 17:17:59 UTC) #9
mtklein
https://codereview.chromium.org/1214443002/diff/60001/src/core/Sk4pxXfermode.h File src/core/Sk4pxXfermode.h (right): https://codereview.chromium.org/1214443002/diff/60001/src/core/Sk4pxXfermode.h#newcode121 src/core/Sk4pxXfermode.h:121: auto colors = (d == Sk4f(0)).thenElse(dstover, On 2015/06/26 17:17:58, ...
5 years, 6 months ago (2015-06-26 17:39:56 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1214443002/80001
5 years, 6 months ago (2015-06-26 17:40:21 UTC) #14
commit-bot: I haz the power
5 years, 6 months ago (2015-06-26 17:46:34 UTC) #15
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://skia.googlesource.com/skia/+/2aab22a58a366df4752c1cf0f004092c6e7be335

Powered by Google App Engine
This is Rietveld 408576698