aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/SkBitmapProcState.cpp4
-rw-r--r--src/shaders/SkImageShader.cpp10
-rw-r--r--src/shaders/SkImageShader.h3
-rw-r--r--src/shaders/SkLocalMatrixShader.h5
-rw-r--r--src/shaders/SkPictureShader.cpp2
5 files changed, 20 insertions, 4 deletions
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index 4b7990c2ee..502f076a6f 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -79,7 +79,11 @@ static bool valid_for_filtering(unsigned dimension) {
}
bool SkBitmapProcInfo::init(const SkMatrix& inv, const SkPaint& paint) {
+#ifdef SK_SUPPORT_LEGACY_LOCAL_ROTATE_SHADER
SkASSERT(!inv.hasPerspective());
+#else
+ SkASSERT(inv.isScaleTranslate());
+#endif
fPixmap.reset();
fInvMatrix = inv;
diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp
index 80751be34a..60412a0382 100644
--- a/src/shaders/SkImageShader.cpp
+++ b/src/shaders/SkImageShader.cpp
@@ -62,7 +62,8 @@ bool SkImageShader::isOpaque() const {
}
bool SkImageShader::IsRasterPipelineOnly(const SkMatrix& ctm, SkColorType ct, SkAlphaType at,
- SkShader::TileMode tx, SkShader::TileMode ty) {
+ SkShader::TileMode tx, SkShader::TileMode ty,
+ const SkMatrix& localM) {
if (ct != kN32_SkColorType) {
return true;
}
@@ -77,13 +78,18 @@ bool SkImageShader::IsRasterPipelineOnly(const SkMatrix& ctm, SkColorType ct, Sk
if (!ctm.isScaleTranslate()) {
return true;
}
+#ifndef SK_SUPPORT_LEGACY_LOCAL_ROTATE_SHADER
+ if (!localM.isScaleTranslate()) {
+ return true;
+ }
+#endif
return false;
}
bool SkImageShader::onIsRasterPipelineOnly(const SkMatrix& ctm) const {
SkBitmapProvider provider(fImage.get(), nullptr);
return IsRasterPipelineOnly(ctm, provider.info().colorType(), provider.info().alphaType(),
- fTileModeX, fTileModeY);
+ fTileModeX, fTileModeY, this->getLocalMatrix());
}
SkShaderBase::Context* SkImageShader::onMakeContext(const ContextRec& rec,
diff --git a/src/shaders/SkImageShader.h b/src/shaders/SkImageShader.h
index 8e592e504c..98856c9fa3 100644
--- a/src/shaders/SkImageShader.h
+++ b/src/shaders/SkImageShader.h
@@ -30,7 +30,8 @@ public:
SkImageShader(sk_sp<SkImage>, TileMode tx, TileMode ty, const SkMatrix* localMatrix);
static bool IsRasterPipelineOnly(const SkMatrix& ctm, SkColorType, SkAlphaType,
- SkShader::TileMode tx, SkShader::TileMode ty);
+ SkShader::TileMode tx, SkShader::TileMode ty,
+ const SkMatrix& localM);
protected:
void flatten(SkWriteBuffer&) const override;
diff --git a/src/shaders/SkLocalMatrixShader.h b/src/shaders/SkLocalMatrixShader.h
index 407c30dc52..a88f95e3b2 100644
--- a/src/shaders/SkLocalMatrixShader.h
+++ b/src/shaders/SkLocalMatrixShader.h
@@ -63,7 +63,12 @@ protected:
#endif
bool onIsRasterPipelineOnly(const SkMatrix& ctm) const override {
+#ifdef SK_SUPPORT_LEGACY_LOCAL_ROTATE_SHADER
return as_SB(fProxyShader)->isRasterPipelineOnly(ctm);
+#else
+ return as_SB(fProxyShader)->isRasterPipelineOnly(SkMatrix::Concat(ctm,
+ this->getLocalMatrix()));
+#endif
}
private:
diff --git a/src/shaders/SkPictureShader.cpp b/src/shaders/SkPictureShader.cpp
index a14c211fba..16f57675fc 100644
--- a/src/shaders/SkPictureShader.cpp
+++ b/src/shaders/SkPictureShader.cpp
@@ -293,7 +293,7 @@ sk_sp<SkShader> SkPictureShader::refBitmapShader(const SkMatrix& viewMatrix, con
bool SkPictureShader::onIsRasterPipelineOnly(const SkMatrix& ctm) const {
return SkImageShader::IsRasterPipelineOnly(ctm, kN32_SkColorType, kPremul_SkAlphaType,
- fTmx, fTmy);
+ fTmx, fTmy, this->getLocalMatrix());
}
bool SkPictureShader::onAppendStages(SkRasterPipeline* p, SkColorSpace* cs, SkArenaAlloc* alloc,