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

Unified Diff: src/effects/SkMatrixConvolutionImageFilter.cpp

Issue 1823573003: Change signatures of filter bounds methods to return a rect. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Hide legacy API behind #ifdef; switch callers to new API 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
Index: src/effects/SkMatrixConvolutionImageFilter.cpp
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 0d14caf1314b3e4011e149802d165e259b7abfaf..7a25f5f7ebc3105cfec7c5e8c39977d40b7db2b5 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 {

Powered by Google App Engine
This is Rietveld 408576698