diff options
author | 2014-01-27 21:03:17 +0000 | |
---|---|---|
committer | 2014-01-27 21:03:17 +0000 | |
commit | 336d1d759590d9bedcbc5a96d0fff79861cf8f7a (patch) | |
tree | 4d903712399b986c2d7b92d18ea1d6ec7aee5120 /src/effects/SkBlurImageFilter.cpp | |
parent | 99f381ad769cc13b0f23c99c47b65c3f236e15cc (diff) |
Implement a computeFastBounds() traversal for SkImageFilter.
This allows for correct culling of primitives which have image filters applied.
R=reed@google.com
BUG=skia:
Review URL: https://codereview.chromium.org/137423005
git-svn-id: http://skia.googlecode.com/svn/trunk@13207 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/SkBlurImageFilter.cpp')
-rw-r--r-- | src/effects/SkBlurImageFilter.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp index 3e60c9bb87..5d9a077d43 100644 --- a/src/effects/SkBlurImageFilter.cpp +++ b/src/effects/SkBlurImageFilter.cpp @@ -224,6 +224,17 @@ bool SkBlurImageFilter::onFilterImage(Proxy* proxy, return true; } + +void SkBlurImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const { + if (getInput(0)) { + getInput(0)->computeFastBounds(src, dst); + } else { + *dst = src; + } + + dst->outset(SkScalarMul(fSigma.width(), SkIntToScalar(3)), + SkScalarMul(fSigma.height(), SkIntToScalar(3))); +} bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm, SkBitmap* result, SkIPoint* offset) { #if SK_SUPPORT_GPU |