Permalink
Browse files

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>
  • Loading branch information...
mtklein authored and Skia Commit-Bot committed May 25, 2017
1 parent 9b868f7 commit b2ef4d6d152300f8a1148aff8a673036b676be33
Showing with 6 additions and 2 deletions.
  1. +6 −2 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
}

0 comments on commit b2ef4d6

Please sign in to comment.