Skip to content

Commit

Permalink
force SkRasterPipeline when using complex blends
Browse files Browse the repository at this point in the history
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
Mike Klein authored and Skia Commit-Bot committed May 25, 2017
1 parent 9b868f7 commit b2ef4d6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/SkBlitter.cpp
Expand Up @@ -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
}
Expand Down

0 comments on commit b2ef4d6

Please sign in to comment.