Refactor color_xform_RGBA() to improve performance
authorMatt Sarett <msarett@google.com>
Fri, 14 Oct 2016 17:04:55 +0000 (13:04 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 14 Oct 2016 17:31:07 +0000 (17:31 +0000)
commitd478a99f5c29f0e8fa64b50831f53232f5577f2d
tree9aec8dcdf52d081188c6cbcc9f47f6c7011b1d4a
parentcd72afa8f19260ab231348083bf0ed51722240d7
Refactor color_xform_RGBA() to improve performance

Now that we've identified this as the "fast path", it has
become (somewhat) stable, and I'm ready to ship it, I feel
comfortable playing games with clang to get the behavior
we want.

toSRGB Performance on HP z620:
Before: 370us or 470us (depending on the mood of my computer)
After:  345us (or better, always)

My guess is that clang optimizers do a better job of interleaving
instructions effectively when we put everything into one function.

Regardless of being silly about performance, I also acutally
prefer how the code reads this way.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3440

Change-Id: Id7a40fb9966341ab184a5331b3e4da19b3af3344
Reviewed-on: https://skia-review.googlesource.com/3440
Commit-Queue: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
src/core/SkColorSpaceXform.cpp