aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkMatrixConvolutionImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2016-03-21 14:51:59 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-21 14:51:59 -0700
commite5e79840ef38ab1d3f03abcf1b2df66fb9940018 (patch)
tree1401c257dfc5f6658c5911499d9037eaee9bacb5 /src/effects/SkMatrixConvolutionImageFilter.cpp
parent989da4a32cd6823359f31c971c3b3f31425e905e (diff)
Change signatures of filter bounds methods to return a rect.
Change filterBounds(), onFilterBounds() and onFilterNodeBounds() and computeFastBounds() to return the destination rectangle. There was no code path that could return false, and returning rects by value is ok now. BUG=skia:5094 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1823573003 Review URL: https://codereview.chromium.org/1823573003
Diffstat (limited to 'src/effects/SkMatrixConvolutionImageFilter.cpp')
-rw-r--r--src/effects/SkMatrixConvolutionImageFilter.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 0d14caf131..7a25f5f7eb 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -323,17 +323,18 @@ bool SkMatrixConvolutionImageFilter::onFilterImageDeprecated(Proxy* proxy,
return true;
}
-void SkMatrixConvolutionImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm,
- SkIRect* dst, MapDirection direction) const {
- *dst = src;
+SkIRect SkMatrixConvolutionImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm,
+ MapDirection direction) const {
+ SkIRect dst = src;
int w = fKernelSize.width() - 1, h = fKernelSize.height() - 1;
- dst->fRight += w;
- dst->fBottom += h;
+ dst.fRight += w;
+ dst.fBottom += h;
if (kReverse_MapDirection == direction) {
- dst->offset(-fKernelOffset);
+ dst.offset(-fKernelOffset);
} else {
- dst->offset(fKernelOffset - SkIPoint::Make(w, h));
+ dst.offset(fKernelOffset - SkIPoint::Make(w, h));
}
+ return dst;
}
bool SkMatrixConvolutionImageFilter::canComputeFastBounds() const {