diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-03 14:58:09 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-03 14:58:09 +0000 |
commit | 47d98c8e85924effc651b09df72027e6801c92a1 (patch) | |
tree | c5c86b63379c49d138210ebedbddb40860a9c17b /src/effects | |
parent | c9b2c885be8d2bb39f1d75cc316278fa8d0fa9f0 (diff) |
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
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkPerlinNoiseShader.cpp | 1 | ||||
-rw-r--r-- | src/effects/SkRectShaderImageFilter.cpp | 4 |
2 files changed, 3 insertions, 2 deletions
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); |