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
This commit is contained in:
senorblanco@chromium.org 2014-03-17 23:41:40 +00:00
parent 1301bf3abf
commit d9cdff67a4
2 changed files with 5 additions and 4 deletions

View File

@ -101,8 +101,7 @@
'../gm/imagefiltersbase.cpp',
'../gm/imagefiltersclipped.cpp',
'../gm/imagefilterscropped.cpp',
# FIXME(senorblanco): re-enable once Win Debug failures are fixed
# '../gm/imagefilterscropexpand.cpp',
'../gm/imagefilterscropexpand.cpp',
'../gm/imagefiltersgraph.cpp',
'../gm/imagefiltersscaled.cpp',
'../gm/internal_links.cpp',

View File

@ -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()));