diff options
author | Mike Klein <mtklein@chromium.org> | 2017-05-25 16:23:09 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-25 21:15:19 +0000 |
commit | b2ef4d6d152300f8a1148aff8a673036b676be33 (patch) | |
tree | fea12b42449f6729187ac2a57063dbe79f1f04cd | |
parent | 9b868f7b405b3739dcb634342a6c9569277afd6c (diff) |
force SkRasterPipeline when using complex blends
Looks like we're faster than legacy pretty much across the board.
out/nanobench -m Hue Saturation Luminosity Color\$ Color_aa\$ --config 8888 -q --ms 2000
Xfermode_Luminosity 80128.68 -> 27189.83
Xfermode_Luminosity_aa 18001.46 -> 14449.67
Xfermode_Color 183520.09 -> 27448.49
Xfermode_Color_aa 34257.75 -> 14694.85
Xfermode_Saturation 80323.96 -> 36449.01
Xfermode_Saturation_aa 19605.81 -> 18576.62
Xfermode_Hue 125866.82 -> 36611.03
Xfermode_Hue_aa 25318.00 -> 18489.33
Change-Id: I842b8f53fb356bf1a5e81502be88e4b34d4ad0dc
Reviewed-on: https://skia-review.googlesource.com/17992
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
-rw-r--r-- | src/core/SkBlitter.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp index f4e43541a9..9eea620e6a 100644 --- a/src/core/SkBlitter.cpp +++ b/src/core/SkBlitter.cpp @@ -784,12 +784,16 @@ bool SkBlitter::UseRasterPipelineBlitter(const SkPixmap& device, const SkPaint& if (device.colorSpace()) { return true; } - // ... unless the shader is raster pipeline-only. if (paint.getShader() && as_SB(paint.getShader())->isRasterPipelineOnly()) { return true; } - + #ifndef SK_SUPPORT_LEGACY_RASTERPIPELINE + // ... or unless the blend mode is complicated enough. + if (paint.getBlendMode() > SkBlendMode::kLastSeparableMode) { + return true; + } + #endif return device.colorType() != kN32_SkColorType; #endif } |