aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkImageSource.cpp
diff options
context:
space:
mode:
authorGravatar Xianzhu Wang <wangxianzhu@chromium.org>2017-09-15 08:47:43 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-15 17:15:54 +0000
commitcb4d58766668b003fea67798027fc25d84acd059 (patch)
treeeec0c5a9e9505eb9db73721dfa74cfea59b0e4d9 /src/effects/SkImageSource.cpp
parentad70c41f678771f889449c296a8ab48640742050 (diff)
Fix SkImageSource::filterBounds()
Previously SkImageSource::filterBounds() uses the default SkImageFilter::onFilterNodeBounds() which returns the input rect. Now override onFilterNodeBounds() in SkImageSource to return src or dst rect (with transform applied). Change-Id: I6681e1ba97affb09ef1ca5bc03b3d0f66c10f149 Reviewed-on: https://skia-review.googlesource.com/46741 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/effects/SkImageSource.cpp')
-rw-r--r--src/effects/SkImageSource.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/effects/SkImageSource.cpp b/src/effects/SkImageSource.cpp
index cd2fb51e94..8ab02ce0cb 100644
--- a/src/effects/SkImageSource.cpp
+++ b/src/effects/SkImageSource.cpp
@@ -146,6 +146,13 @@ SkRect SkImageSource::computeFastBounds(const SkRect& src) const {
return fDstRect;
}
+SkIRect SkImageSource::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm,
+ MapDirection direction) const {
+ SkRect bounds = kForward_MapDirection == direction ? fDstRect : fSrcRect;
+ ctm.mapRect(&bounds);
+ return bounds.roundOut();
+}
+
#ifndef SK_IGNORE_TO_STRING
void SkImageSource::toString(SkString* str) const {
str->appendf("SkImageSource: (");