aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkImageFilter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkImageFilter.cpp')
-rw-r--r--src/core/SkImageFilter.cpp22
1 files changed, 22 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;