aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-24 15:14:26 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-24 15:14:26 +0000
commit985fa79141a82ec5e9bb5b01d9090aef76fac234 (patch)
treebffb90e3947b6f94e3358eb6c10e5cd4c69c91ae /src/effects
parent055f9086a83423b33d69dda5b2c847b2c7c09718 (diff)
Protect filter_texture() against render target change.
Fix blend filters when input textures are "sloppy" (approx scratch texture match) Add a new test case to gm/imagefiltersgraph, and reduce its size. NOTE: this will require new baselines for the imagefiltersgraph GM. BUG=950 Review URL: https://codereview.appspot.com/6769043 git-svn-id: http://skia.googlecode.com/svn/trunk@6073 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/SkBlendImageFilter.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/effects/SkBlendImageFilter.cpp b/src/effects/SkBlendImageFilter.cpp
index 455ddcb72e..b93190f679 100644
--- a/src/effects/SkBlendImageFilter.cpp
+++ b/src/effects/SkBlendImageFilter.cpp
@@ -203,11 +203,14 @@ GrTexture* SkBlendImageFilter::onFilterImageGPU(Proxy* proxy, GrTexture* src, co
GrContext::AutoRenderTarget art(context, dst->asRenderTarget());
GrContext::AutoClip ac(context, rect);
- GrMatrix sampleM;
- sampleM.setIDiv(background->width(), background->height());
+ GrMatrix backgroundTexMatrix, foregroundTexMatrix;
+ backgroundTexMatrix.setIDiv(background->width(), background->height());
+ foregroundTexMatrix.setIDiv(foreground->width(), foreground->height());
GrPaint paint;
- paint.colorSampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect, (background.get())), sampleM)->unref();
- paint.colorSampler(1)->setCustomStage(SkNEW_ARGS(GrBlendEffect, (fMode, foreground.get())), sampleM)->unref();
+ paint.colorSampler(0)->setCustomStage(
+ SkNEW_ARGS(GrSingleTextureEffect, (background.get())), backgroundTexMatrix)->unref();
+ paint.colorSampler(1)->setCustomStage(
+ SkNEW_ARGS(GrBlendEffect, (fMode, foreground.get())), foregroundTexMatrix)->unref();
context->drawRect(paint, rect);
return dst;
}