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

Unified Diff: src/core/SkMatrixImageFilter.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/core/SkMatrixImageFilter.cpp
diff --git a/src/core/SkMatrixImageFilter.cpp b/src/core/SkMatrixImageFilter.cpp
index 5a585efffcff62cc9456aa841eb26b2d4201db3a..ec221fdcacf96f1f25a3196c91ea49da1cb24893 100644
--- a/src/core/SkMatrixImageFilter.cpp
+++ b/src/core/SkMatrixImageFilter.cpp
@@ -91,36 +91,32 @@ bool SkMatrixImageFilter::onFilterImageDeprecated(Proxy* proxy,
return true;
}
-void SkMatrixImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const {
- SkRect bounds = src;
- if (getInput(0)) {
- getInput(0)->computeFastBounds(src, &bounds);
- }
- fTransform.mapRect(dst, bounds);
+SkRect SkMatrixImageFilter::computeFastBounds(const SkRect& src) const {
+ SkRect bounds = this->getInput(0) ? this->getInput(0)->computeFastBounds(src) : src;
+ SkRect dst;
+ fTransform.mapRect(&dst, bounds);
+ return dst;
}
-void SkMatrixImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm,
- SkIRect* dst, MapDirection direction) const {
+SkIRect SkMatrixImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm,
+ MapDirection direction) const {
SkMatrix matrix;
if (!ctm.invert(&matrix)) {
- *dst = src;
- return;
+ return src;
}
if (kForward_MapDirection == direction) {
matrix.postConcat(fTransform);
} else {
SkMatrix transformInverse;
if (!fTransform.invert(&transformInverse)) {
- *dst = src;
- return;
+ return src;
}
matrix.postConcat(transformInverse);
}
matrix.postConcat(ctm);
SkRect floatBounds;
matrix.mapRect(&floatBounds, SkRect::Make(src));
- SkIRect bounds = floatBounds.roundOut();
- *dst = bounds;
+ return floatBounds.roundOut();
}
#ifndef SK_IGNORE_TO_STRING

Powered by Google App Engine
This is Rietveld 408576698