diff options
author | 2017-08-23 12:08:37 -0400 | |
---|---|---|
committer | 2017-08-23 16:38:25 +0000 | |
commit | 59a62ed9462efa58573594da0f0088bba37960af (patch) | |
tree | e565bdc1480549bb1d2fb2ac2153d9a8c64b95a7 /src/jumper/SkJumper_stages.cpp | |
parent | 3cf781d0e0afc0bbd8a9cb18ad4b126ebcafbbe5 (diff) |
ColorBurn/ColorDodge stage tweaks
Minor speedup.
Before:
10212.01 ? blendmode_rect_ColorBurn 8888
9216.78 ? blendmode_rect_ColorDodge 8888
After:
9635.44 ? blendmode_rect_ColorBurn 8888
8820.22 ? blendmode_rect_ColorDodge 8888
Change-Id: I9e8a9aa21e2370de3174c31821fb0676260d2643
Reviewed-on: https://skia-review.googlesource.com/37620
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src/jumper/SkJumper_stages.cpp')
-rw-r--r-- | src/jumper/SkJumper_stages.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/jumper/SkJumper_stages.cpp b/src/jumper/SkJumper_stages.cpp index ca8b460aaa..23b756e9ed 100644 --- a/src/jumper/SkJumper_stages.cpp +++ b/src/jumper/SkJumper_stages.cpp @@ -351,14 +351,14 @@ BLEND_MODE(difference) { return s + d - two(min(s*da, d*sa)); } BLEND_MODE(exclusion) { return s + d - two(s*d); } BLEND_MODE(colorburn) { - return if_then_else(d == da, d + s*inv(da), - if_then_else(s == 0, s + d*inv(sa), - sa*(da - min(da, (da-d)*sa/s)) + s*inv(da) + d*inv(sa))); + return if_then_else(d == da, d + s*inv(da), + if_then_else(s == 0, /* s + */ d*inv(sa), + sa*(da - min(da, (da-d)*sa*rcp(s))) + s*inv(da) + d*inv(sa))); } BLEND_MODE(colordodge) { - return if_then_else(d == 0, d + s*inv(da), - if_then_else(s == sa, s + d*inv(sa), - sa*min(da, (d*sa)/(sa - s)) + s*inv(da) + d*inv(sa))); + return if_then_else(d == 0, /* d + */ s*inv(da), + if_then_else(s == sa, s + d*inv(sa), + sa*min(da, (d*sa)*rcp(sa - s)) + s*inv(da) + d*inv(sa))); } BLEND_MODE(hardlight) { return s*inv(da) + d*inv(sa) |