Skip to content

Commit b2ef4d6

Browse files
Mike KleinSkia Commit-Bot
authored andcommitted
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>
1 parent 9b868f7 commit b2ef4d6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/core/SkBlitter.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,12 +784,16 @@ bool SkBlitter::UseRasterPipelineBlitter(const SkPixmap& device, const SkPaint&
784784
if (device.colorSpace()) {
785785
return true;
786786
}
787-
788787
// ... unless the shader is raster pipeline-only.
789788
if (paint.getShader() && as_SB(paint.getShader())->isRasterPipelineOnly()) {
790789
return true;
791790
}
792-
791+
#ifndef SK_SUPPORT_LEGACY_RASTERPIPELINE
792+
// ... or unless the blend mode is complicated enough.
793+
if (paint.getBlendMode() > SkBlendMode::kLastSeparableMode) {
794+
return true;
795+
}
796+
#endif
793797
return device.colorType() != kN32_SkColorType;
794798
#endif
795799
}

0 commit comments

Comments
 (0)