aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-17 23:41:40 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-17 23:41:40 +0000
commitd9cdff67a40e21cf45d3e07b483b9c745bd4481f (patch)
tree79db088647c2608c809a43a4e8e3e84a43cdbae3 /src
parent1301bf3abfe355f9aadd53d5dbf04926013231ba (diff)
Fix GPU displacement with expanding crop rects.
Fix GPU displacement with expanding crop rects, and re-enable the imagefilterscropexpand GM. There were two bugs: the result texture was being created at input color bitmap size, not the cropped bounds size, and the matrix in GrContext was not being set to identity before draw. R=junov@chromium.org Review URL: https://codereview.chromium.org/195973007 git-svn-id: http://skia.googlecode.com/svn/trunk@13844 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/effects/SkDisplacementMapEffect.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 4b26a5f846..0200cabff8 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -384,8 +384,8 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src,
GrTextureDesc desc;
desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit;
- desc.fWidth = colorBM.width();
- desc.fHeight = colorBM.height();
+ desc.fWidth = bounds.width();
+ desc.fHeight = bounds.height();
desc.fConfig = kSkia8888_GrPixelConfig;
GrAutoScratchTexture ast(context, desc);
@@ -410,6 +410,8 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src,
color))->unref();
SkIRect colorBounds = bounds;
colorBounds.offset(-colorOffset);
+ GrContext::AutoMatrix am;
+ am.setIdentity(context);
SkMatrix matrix;
matrix.setTranslate(-SkIntToScalar(colorBounds.x()),
-SkIntToScalar(colorBounds.y()));