aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBlitter.cpp
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-07-11 22:47:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-12 03:14:05 +0000
commitc4176a2fa5aab30e5886f05bbe20de225dbe997b (patch)
tree04da222232e9a2df982cb702ba329a5f91b203e3 /src/core/SkBlitter.cpp
parenta30d407b4fe95335598f62644010d017195e6aac (diff)
Always use raster pipeline for perspective
Change-Id: I6205769ea77e12647985496a5c74d3754edd3108 Reviewed-on: https://skia-review.googlesource.com/22365 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkBlitter.cpp')
-rw-r--r--src/core/SkBlitter.cpp11
1 files changed, 9 insertions, 2 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;