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

Unified Diff: src/effects/SkMorphologyImageFilter.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/SkMorphologyImageFilter.cpp
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 61b0c339c9fafc47fd549ba3321253f6eaeefec4..204f4f3a628e426338ffa8dc9269333f0490dc8a 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -142,22 +142,18 @@ bool SkDilateImageFilter::onFilterImageDeprecated(Proxy* proxy,
proxy, source, ctx, dst, offset);
}
-void SkMorphologyImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const {
- if (this->getInput(0)) {
- this->getInput(0)->computeFastBounds(src, dst);
- } else {
- *dst = src;
- }
- dst->outset(SkIntToScalar(fRadius.width()), SkIntToScalar(fRadius.height()));
+SkRect SkMorphologyImageFilter::computeFastBounds(const SkRect& src) const {
+ SkRect bounds = this->getInput(0) ? this->getInput(0)->computeFastBounds(src) : src;
+ bounds.outset(SkIntToScalar(fRadius.width()), SkIntToScalar(fRadius.height()));
+ return bounds;
}
-void SkMorphologyImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm,
- SkIRect* dst, MapDirection) const {
- *dst = src;
+SkIRect SkMorphologyImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm,
+ MapDirection) const {
SkVector radius = SkVector::Make(SkIntToScalar(this->radius().width()),
SkIntToScalar(this->radius().height()));
ctm.mapVectors(&radius, 1);
- dst->outset(SkScalarCeilToInt(radius.x()), SkScalarCeilToInt(radius.y()));
+ return src.makeOutset(SkScalarCeilToInt(radius.x()), SkScalarCeilToInt(radius.y()));
}
SkFlattenable* SkErodeImageFilter::CreateProc(SkReadBuffer& buffer) {

Powered by Google App Engine
This is Rietveld 408576698