From 47d98c8e85924effc651b09df72027e6801c92a1 Mon Sep 17 00:00:00 2001 From: "senorblanco@chromium.org" Date: Mon, 3 Mar 2014 14:58:09 +0000 Subject: Fix CTM scaling and clipping of SkRectShaderImageFilter. Pass the CTM as part of the local matrix passed by SkRectShaderImageFilter. Teach SkPerlinNoiseShader to respect the local matrix. Embiggen imagefiltersscaled GM size to accommodate the new test cases. Note: will require rebaselines of imagefiltersscaled and imagefiltersclipped R=sugoi@chromium.org BUG=skia: Review URL: https://codereview.chromium.org/184973007 git-svn-id: http://skia.googlecode.com/svn/trunk@13637 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/effects/SkPerlinNoiseShader.cpp | 1 + src/effects/SkRectShaderImageFilter.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/effects') diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp index 48a25f9a5b..47de924b99 100644 --- a/src/effects/SkPerlinNoiseShader.cpp +++ b/src/effects/SkPerlinNoiseShader.cpp @@ -450,6 +450,7 @@ SkScalar SkPerlinNoiseShader::calculateTurbulenceValueForPoint( SkPMColor SkPerlinNoiseShader::shade(const SkPoint& point, StitchData& stitchData) { SkMatrix matrix = fMatrix; + matrix.postConcat(getLocalMatrix()); SkMatrix invMatrix; if (!matrix.invert(&invMatrix)) { invMatrix.reset(); diff --git a/src/effects/SkRectShaderImageFilter.cpp b/src/effects/SkRectShaderImageFilter.cpp index 18e38470bc..27b39d7fb1 100644 --- a/src/effects/SkRectShaderImageFilter.cpp +++ b/src/effects/SkRectShaderImageFilter.cpp @@ -69,8 +69,8 @@ bool SkRectShaderImageFilter::onFilterImage(Proxy* proxy, SkCanvas canvas(device.get()); SkPaint paint; paint.setShader(fShader); - SkMatrix matrix; - matrix.setTranslate(-SkIntToScalar(bounds.fLeft), -SkIntToScalar(bounds.fTop)); + SkMatrix matrix(ctm); + matrix.postTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top())); fShader->setLocalMatrix(matrix); SkRect rect = SkRect::MakeWH(SkIntToScalar(bounds.width()), SkIntToScalar(bounds.height())); canvas.drawRect(rect, paint); -- cgit v1.2.3