diff --git a/src/image/SkImageShader.cpp b/src/image/SkImageShader.cpp index 152007d6e8..da7bb2fb96 100644 --- a/src/image/SkImageShader.cpp +++ b/src/image/SkImageShader.cpp @@ -300,6 +300,13 @@ bool SkImageShader::onAppendStages(SkRasterPipeline* p, SkColorSpace* dst, SkFal return false; } + // When the matrix is just an integer translate, bilerp == nearest neighbor. + if (matrix.getType() <= SkMatrix::kTranslate_Mask && + matrix.getTranslateX() == (int)matrix.getTranslateX() && + matrix.getTranslateY() == (int)matrix.getTranslateY()) { + quality = kNone_SkFilterQuality; + } + // TODO: bilerp if (quality != kNone_SkFilterQuality) { return false;