aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
diff options
context:
space:
mode:
authorGravatar Xianzhu Wang <wangxianzhu@chromium.org>2017-09-15 19:57:53 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-16 18:55:53 +0000
commitbf12c079707a89f683ad0a6c989127fa20d9d202 (patch)
tree2fa4b72ee252ba02e5a46be17ba24f6453efd8a4 /src/effects
parentb8a7c8cd1c410465806deda32181618b04e8517d (diff)
Reland "Fix SkImageSource::filterBounds()"
This relands commit cb4d58766668b003fea67798027fc25d84acd059 which was reverted by commit b6d2be1330f16fe05f1eed5abda927c0fbb50055 because the original CL broke some blink layout tests. This reland let SkImageSource::filterBounds() return the dst rect with ctm applied regardless of direction. Original description: > 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: I915b7889ff59829ddbc4479cd66d75a0bb581e54 Reviewed-on: https://skia-review.googlesource.com/47501 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Stephen White <senorblanco@chromium.org>
Diffstat (limited to 'src/effects')
-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..7b8ce0be95 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 dstRect = fDstRect;
+ ctm.mapRect(&dstRect);
+ return dstRect.roundOut();
+}
+
#ifndef SK_IGNORE_TO_STRING
void SkImageSource::toString(SkString* str) const {
str->appendf("SkImageSource: (");