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

Issue 1242743004: De-templatize Sk4pxXfermode code a bit. (Closed)

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

Description

De-templatize Sk4pxXfermode code a bit. This deduplicates a few pieces of code: - we end up with one copy of each xfer32() driver loop instead of one per xfermode; - we end up with two* copies of each xfermode implementation instead of ten**. * For a given Mode: Mode() itself and xfer_aa<Mode>(). ** From unrolling: twice at a stride of 8, once at 4, once at 2, and once at 1, then all again for when we have AA. This decreases the size of SkXfermode.o from 1.5M to 620K on x86-64 and from 1.3M to 680K on ARMv7+NEON. If we wanted to, we could eliminate the xfer_aa<Mode>() copy by tagging each Mode() function as __attribute__((noinline)) or its equivalent. This would result in another ~100K space savings. Performance is affected in proportion to the original xfermode speed: fast modes like Plus take the largest proportional hit, and slow modes like HardLight or SoftLight see essentially no hit at all. This adds SK_VECTORCALL to help keep this code fast on ARMv7 and Windows. I've looked at the ARMv7 generated code... it looks good, even pretty. For compatibility with SK_VECTORCALL, we now pass the vector-sized arguments by value instead of by reference. Some refactoring now allows us to declare each mode as just a static function instead of a struct, which simplifies things. TBR=reed@google.com No public API changes. BUG=skia: Committed: https://skia.googlesource.com/skia/+/e617e1525916d7ee684142728c0905828caf49da CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-Arm7-Debug-Android_NoNeon-Trybot Committed: https://skia.googlesource.com/skia/+/cd1930d4f19297c4089d7cb278243e4815c5793d

Patch Set 1 #

Patch Set 2 : missing SK_VECTORCALL for xfer_aa #

Patch Set 3 : fix no-neon build #

Patch Set 4 : really fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -66 lines) Patch
M include/core/SkPostConfig.h View 1 chunk +8 lines, -0 lines 0 comments Download
M src/core/Sk4pxXfermode.h View 1 2 3 7 chunks +72 lines, -66 lines 0 comments Download

Messages

Total messages: 27 (11 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1242743004/1
5 years, 5 months ago (2015-07-21 18:10:32 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86-Debug-Trybot/builds/2138) Build-Win-MSVC-x86_64-Debug-Trybot on ...
5 years, 5 months ago (2015-07-21 18:14:03 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1242743004/20001
5 years, 5 months ago (2015-07-21 18:17:02 UTC) #6
mtklein_C
5 years, 5 months ago (2015-07-21 18:30:37 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 5 months ago (2015-07-21 18:34:47 UTC) #10
msarett
lgtm I find it interesting that we are willing to sacrifice a little performance to ...
5 years, 5 months ago (2015-07-21 18:59:21 UTC) #11
mtklein
On 2015/07/21 18:59:21, msarett wrote: > lgtm > > I find it interesting that we ...
5 years, 5 months ago (2015-07-21 19:01:26 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1242743004/20001
5 years, 5 months ago (2015-07-21 19:03:13 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://skia.googlesource.com/skia/+/e617e1525916d7ee684142728c0905828caf49da
5 years, 5 months ago (2015-07-21 19:03:40 UTC) #15
mtklein
A revert of this CL (patchset #2 id:20001) has been created in https://codereview.chromium.org/1245273005/ by mtklein@google.com. ...
5 years, 5 months ago (2015-07-21 19:07:41 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1242743004/40001
5 years, 5 months ago (2015-07-21 19:14:12 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: Build-Ubuntu-GCC-Arm7-Debug-Android_NoNeon-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-Arm7-Debug-Android_NoNeon-Trybot/builds/2)
5 years, 5 months ago (2015-07-21 19:17:11 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1242743004/60001
5 years, 5 months ago (2015-07-21 19:18:40 UTC) #24
mtklein
On 2015/07/21 18:59:21, msarett wrote: > lgtm > > I find it interesting that we ...
5 years, 5 months ago (2015-07-21 19:19:24 UTC) #25
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://skia.googlesource.com/skia/+/cd1930d4f19297c4089d7cb278243e4815c5793d
5 years, 5 months ago (2015-07-21 19:39:59 UTC) #26
mtklein
5 years, 5 months ago (2015-07-21 19:56:16 UTC) #27
Message was sent while issue was closed.
On 2015/07/21 19:19:24, mtklein wrote:
> On 2015/07/21 18:59:21, msarett wrote:
> > lgtm
> > 
> > I find it interesting that we are willing to sacrifice a little performance
to
> > decrease the size of the binary.  Out of curiosity, was the revert of the
> > original CL caused by some sort of automated test failure or did you catch
the
> > problem yourself?
> 
> Here's a proxy chart we can watch based on data available in
http://perf.skia.org:
> 
> https://perf.skia.org/#3812

And here's the corresponding speed chart, lower is better:
https://perf.skia.org/#3816

Powered by Google App Engine
This is Rietveld 408576698