Index: src/effects/SkComposeImageFilter.cpp |
diff --git a/src/effects/SkComposeImageFilter.cpp b/src/effects/SkComposeImageFilter.cpp |
index 90844ef9dca23b35189c928846ac7372e945b48b..b06e562baf77c21032644098bb7dc6641b7cfbab 100644 |
--- a/src/effects/SkComposeImageFilter.cpp |
+++ b/src/effects/SkComposeImageFilter.cpp |
@@ -23,8 +23,14 @@ void SkComposeImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) con |
SkSpecialImage* SkComposeImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx, |
SkIPoint* offset) const { |
+ // The bounds passed to the inner filter must be filtered by the outer |
+ // filter, so that the inner filter produces the pixels that the outer |
+ // filter requires as input. This matters if the outer filter moves pixels. |
+ SkIRect innerClipBounds = ctx.clipBounds(); |
Stephen White
2016/03/21 15:09:18
I wouldn't bother initializing this, since the cal
jbroman
2016/03/21 15:13:11
What I'm unsure about is the case where filterBoun
Stephen White
2016/03/21 15:18:58
Yeah, it's kind of a wart on the API: I don't thin
jbroman
2016/03/21 15:22:28
OK, done.
|
+ getInput(0)->filterBounds(ctx.clipBounds(), ctx.ctm(), &innerClipBounds); |
+ Context innerContext(ctx.ctm(), innerClipBounds, ctx.cache()); |
SkIPoint innerOffset = SkIPoint::Make(0, 0); |
- SkAutoTUnref<SkSpecialImage> inner(this->filterInput(1, source, ctx, &innerOffset)); |
+ SkAutoTUnref<SkSpecialImage> inner(this->filterInput(1, source, innerContext, &innerOffset)); |
if (!inner) { |
return nullptr; |
} |