aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkImageFilter.cpp22
-rw-r--r--src/core/SkPaint.cpp4
2 files changed, 26 insertions, 0 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index d62685a17c..cb1d9fb571 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -111,6 +111,28 @@ bool SkImageFilter::filterBounds(const SkIRect& src, const SkMatrix& ctm,
return this->onFilterBounds(src, ctm, dst);
}
+void SkImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const {
+ if (0 == fInputCount) {
+ *dst = src;
+ return;
+ }
+ if (this->getInput(0)) {
+ this->getInput(0)->computeFastBounds(src, dst);
+ } else {
+ *dst = src;
+ }
+ for (int i = 1; i < fInputCount; i++) {
+ SkImageFilter* input = this->getInput(i);
+ if (input) {
+ SkRect bounds;
+ input->computeFastBounds(src, &bounds);
+ dst->join(bounds);
+ } else {
+ dst->join(src);
+ }
+ }
+}
+
bool SkImageFilter::onFilterImage(Proxy*, const SkBitmap&, const SkMatrix&,
SkBitmap*, SkIPoint*) {
return false;
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index f576015ba0..cc6d7ba1b3 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -2288,6 +2288,10 @@ const SkRect& SkPaint::doComputeFastBounds(const SkRect& origSrc,
this->getMaskFilter()->computeFastBounds(*storage, storage);
}
+ if (this->getImageFilter()) {
+ this->getImageFilter()->computeFastBounds(*storage, storage);
+ }
+
return *storage;
}