diff options
Diffstat (limited to 'src/shaders')
-rw-r--r-- | src/shaders/gradients/SkLinearGradient.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/shaders/gradients/SkLinearGradient.cpp b/src/shaders/gradients/SkLinearGradient.cpp index 52f380b3d3..2bce02e782 100644 --- a/src/shaders/gradients/SkLinearGradient.cpp +++ b/src/shaders/gradients/SkLinearGradient.cpp @@ -86,11 +86,9 @@ SkShaderBase::Context* SkLinearGradient::onMakeContext( SkShaderBase::Context* SkLinearGradient::onMakeBurstPipelineContext( const ContextRec& rec, SkArenaAlloc* alloc) const { - // TODO: refine heuristic. - if (fColorCount <= 8) { - return nullptr; - } - return CheckedMakeContext<LinearGradient4fContext>(alloc, *this, rec); + // Raster pipeline has a 2-stop specialization faster than our burst. + return fColorCount > 2 ? CheckedMakeContext<LinearGradient4fContext>(alloc, *this, rec) + : nullptr; } bool SkLinearGradient::adjustMatrixAndAppendStages(SkArenaAlloc* alloc, |