aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkMergeImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2016-01-28 08:23:02 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-28 08:23:02 -0800
commitd8ff5b336e586ad971ebcafa5fb2eb1e7ac95589 (patch)
tree9e71ad81d0241b430b9537ea976876fe20a5c6ec /src/effects/SkMergeImageFilter.cpp
parent382f8bdbf0698d80c2cc64112205ab18aafab2dd (diff)
Image filters: Make a recursive, forward-mapping bounds
traversal which respects the CropRect. This is useful when you want the device-space bounds of a primitive after filtering. (This may also eventually subsume computeFastBounds()). This CL generalizes filterBounds() and onFilterBounds() to take a mapping direction. It also makes filterBounds() responsible for calling onFilterNodeBounds() and applying the crop rect, simplifying onFilterBounds(). BUG=skia:4627 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1612953004 Review URL: https://codereview.chromium.org/1612953004
Diffstat (limited to 'src/effects/SkMergeImageFilter.cpp')
-rwxr-xr-xsrc/effects/SkMergeImageFilter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp
index 2ae8b35cd0..12fff9533a 100755
--- a/src/effects/SkMergeImageFilter.cpp
+++ b/src/effects/SkMergeImageFilter.cpp
@@ -92,7 +92,8 @@ bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
}
// Apply the crop rect to the union of the inputs' bounds.
- if (!this->getCropRect().applyTo(bounds, ctx, &bounds)) {
+ this->getCropRect().applyTo(bounds, ctx.ctm(), &bounds);
+ if (!bounds.intersect(ctx.clipBounds())) {
return false;
}