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

Unified Diff: src/effects/SkComposeImageFilter.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/SkComposeImageFilter.cpp
diff --git a/src/effects/SkComposeImageFilter.cpp b/src/effects/SkComposeImageFilter.cpp
index b9216611ab81525e1847f39c8cd2de8ff5991221..86a4d503892e9d216b1354266fbd2614966c30c7 100644
--- a/src/effects/SkComposeImageFilter.cpp
+++ b/src/effects/SkComposeImageFilter.cpp
@@ -12,13 +12,11 @@
#include "SkWriteBuffer.h"
-void SkComposeImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const {
+SkRect SkComposeImageFilter::computeFastBounds(const SkRect& src) const {
SkImageFilter* outer = getInput(0);
SkImageFilter* inner = getInput(1);
- SkRect tmp;
- inner->computeFastBounds(src, &tmp);
- outer->computeFastBounds(tmp, dst);
+ return outer->computeFastBounds(inner->computeFastBounds(src));
}
SkSpecialImage* SkComposeImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
@@ -27,7 +25,7 @@ SkSpecialImage* SkComposeImageFilter::onFilterImage(SkSpecialImage* source, cons
// filter, so that the inner filter produces the pixels that the outer
// filter requires as input. This matters if the outer filter moves pixels.
SkIRect innerClipBounds;
- getInput(0)->filterBounds(ctx.clipBounds(), ctx.ctm(), &innerClipBounds);
+ innerClipBounds = getInput(0)->filterBounds(ctx.clipBounds(), ctx.ctm());
Context innerContext(ctx.ctm(), innerClipBounds, ctx.cache());
SkIPoint innerOffset = SkIPoint::Make(0, 0);
SkAutoTUnref<SkSpecialImage> inner(this->filterInput(1, source, innerContext, &innerOffset));
@@ -51,16 +49,12 @@ SkSpecialImage* SkComposeImageFilter::onFilterImage(SkSpecialImage* source, cons
return outer.release();
}
-bool SkComposeImageFilter::onFilterBounds(const SkIRect& src,
- const SkMatrix& ctm,
- SkIRect* dst,
- MapDirection direction) const {
+SkIRect SkComposeImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
+ MapDirection direction) const {
SkImageFilter* outer = this->getInput(0);
SkImageFilter* inner = this->getInput(1);
- SkIRect tmp;
- return inner->filterBounds(src, ctm, &tmp, direction) &&
- outer->filterBounds(tmp, ctm, dst, direction);
+ return outer->filterBounds(inner->filterBounds(src, ctm, direction), ctm, direction);
}
SkFlattenable* SkComposeImageFilter::CreateProc(SkReadBuffer& buffer) {

Powered by Google App Engine
This is Rietveld 408576698