Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(638)

Unified Diff: src/effects/SkMergeImageFilter.cpp

Issue 1848953002: Image filters: optimize crop rect application (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixes per review remarks Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkPaintImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMergeImageFilter.cpp
diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp
index 07b2c1cf3e9ef8de8309144c6c89c72407b8763c..cd16d43db3e65424cfef26c910bb3afbfbf4f46b 100755
--- a/src/effects/SkMergeImageFilter.cpp
+++ b/src/effects/SkMergeImageFilter.cpp
@@ -86,7 +86,10 @@ sk_sp<SkSpecialImage> SkMergeImageFilter::onFilterImage(SkSpecialImage* source,
}
// Apply the crop rect to the union of the inputs' bounds.
- this->getCropRect().applyTo(bounds, ctx.ctm(), &bounds);
+ // Note that the crop rect can only reduce the bounds, since this
+ // filter does not affect transparent black.
+ bool embiggen = false;
+ this->getCropRect().applyTo(bounds, ctx.ctm(), embiggen, &bounds);
if (!bounds.intersect(ctx.clipBounds())) {
return nullptr;
}
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkPaintImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698