aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkMatrixConvolutionImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2016-04-01 16:41:10 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-01 16:41:10 -0700
commit6db0a7bdceb6be85721bfb0db8dea7fd27db5970 (patch)
treeb963703827c0a0b99e40b6a4d7e5a9afed9947a1 /src/effects/SkMatrixConvolutionImageFilter.cpp
parent2d9c6f81353597aebf5934547e5cba7a872196fb (diff)
Image filters: optimize crop rect application.
If a filter does not affect transparent black, there's no reason to allow the crop rect to expand beyond the optimal size determined by onFilterNodeBounds(). So don't enlarge the bounds unless the filter affects transparent black. In order to determine which filters affect transparent black, I've pulled the inverse of the canComputeFastBounds() logic into a non-recursive, affectsTransparentBlack() virtual, and left canComputeFastBounds() as a non-virtual, recursive function that calls it. BUG=599933 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1848953002 TBR=reed@google.com Review URL: https://codereview.chromium.org/1848953002
Diffstat (limited to 'src/effects/SkMatrixConvolutionImageFilter.cpp')
-rw-r--r--src/effects/SkMatrixConvolutionImageFilter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index c8b43bbfd0..2a32fd5cdc 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -337,10 +337,10 @@ SkIRect SkMatrixConvolutionImageFilter::onFilterNodeBounds(const SkIRect& src, c
return dst;
}
-bool SkMatrixConvolutionImageFilter::canComputeFastBounds() const {
+bool SkMatrixConvolutionImageFilter::affectsTransparentBlack() const {
// Because the kernel is applied in device-space, we have no idea what
// pixels it will affect in object-space.
- return false;
+ return true;
}
#if SK_SUPPORT_GPU