diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkBlitter.cpp | 11 | ||||
-rw-r--r-- | src/core/SkBlitter.h | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp index 418ac242f8..24414f3184 100644 --- a/src/core/SkBlitter.cpp +++ b/src/core/SkBlitter.cpp @@ -780,7 +780,8 @@ SkShaderBase::ContextRec::DstType SkBlitter::PreferredShaderDest(const SkImageIn // hack for testing, not to be exposed to clients bool gSkForceRasterPipelineBlitter; -bool SkBlitter::UseRasterPipelineBlitter(const SkPixmap& device, const SkPaint& paint) { +bool SkBlitter::UseRasterPipelineBlitter(const SkPixmap& device, const SkPaint& paint, + const SkMatrix& matrix) { if (gSkForceRasterPipelineBlitter) { return true; } @@ -807,6 +808,12 @@ bool SkBlitter::UseRasterPipelineBlitter(const SkPixmap& device, const SkPaint& if (paint.getBlendMode() > SkBlendMode::kLastSeparableMode) { return true; } + + // ... or unless we have to deal with perspective. + if (matrix.getType() & SkMatrix::kPerspective_Mask) { + return true; + } + return device.colorType() != kN32_SkColorType; #endif } @@ -881,7 +888,7 @@ SkBlitter* SkBlitter::Choose(const SkPixmap& device, paint.writable()->setDither(false); } - if (UseRasterPipelineBlitter(device, *paint)) { + if (UseRasterPipelineBlitter(device, *paint, matrix)) { auto blitter = SkCreateRasterPipelineBlitter(device, *paint, matrix, alloc); SkASSERT(blitter); return blitter; diff --git a/src/core/SkBlitter.h b/src/core/SkBlitter.h index 6558045f4f..921e8f367b 100644 --- a/src/core/SkBlitter.h +++ b/src/core/SkBlitter.h @@ -150,7 +150,7 @@ public: static SkShaderBase::ContextRec::DstType PreferredShaderDest(const SkImageInfo&); - static bool UseRasterPipelineBlitter(const SkPixmap&, const SkPaint&); + static bool UseRasterPipelineBlitter(const SkPixmap&, const SkPaint&, const SkMatrix&); protected: SkAutoMalloc fBlitMemory; |