aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2014-10-29 12:36:32 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-29 12:36:32 -0700
commit8f3937d9fcb28018ec14db6697d41b645716d589 (patch)
treee22ff14a48607de288266df4dff504c2b5156297 /src
parenta5cf665997d73169e2f5260eaf9643af1f309762 (diff)
Fix bounds computation of all 0-input filters.
The SkRectShaderImageFilter had the same bug as previously fixed for SkBitmapSource and SkPictureImageFilter. Rather than copy-and-paste the implementation, this change makes all filters with 0 inputs return their source bounds, instead of returning false. BUG=427251 Review URL: https://codereview.chromium.org/681643003
Diffstat (limited to 'src')
-rw-r--r--src/core/SkImageFilter.cpp3
-rw-r--r--src/effects/SkBitmapSource.cpp6
-rw-r--r--src/effects/SkPictureImageFilter.cpp7
3 files changed, 2 insertions, 14 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index bba5ec0c74..8f49a06c15 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -342,7 +342,8 @@ bool SkImageFilter::applyCropRect(const Context& ctx, Proxy* proxy, const SkBitm
bool SkImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
SkIRect* dst) const {
if (fInputCount < 1) {
- return false;
+ *dst = src;
+ return true;
}
SkIRect bounds;
diff --git a/src/effects/SkBitmapSource.cpp b/src/effects/SkBitmapSource.cpp
index aee4a361f2..0d9315b2ab 100644
--- a/src/effects/SkBitmapSource.cpp
+++ b/src/effects/SkBitmapSource.cpp
@@ -97,9 +97,3 @@ bool SkBitmapSource::onFilterImage(Proxy* proxy, const SkBitmap&, const Context&
void SkBitmapSource::computeFastBounds(const SkRect&, SkRect* dst) const {
*dst = fDstRect;
}
-
-bool SkBitmapSource::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
- SkIRect* dst) const {
- *dst = src;
- return true;
-}
diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp
index bed19ef89d..30fbac184a 100644
--- a/src/effects/SkPictureImageFilter.cpp
+++ b/src/effects/SkPictureImageFilter.cpp
@@ -110,10 +110,3 @@ bool SkPictureImageFilter::onFilterImage(Proxy* proxy, const SkBitmap&, const Co
offset->fY = bounds.fTop;
return true;
}
-
-bool SkPictureImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
- SkIRect* dst) const {
- *dst = src;
- return true;
-}
-