aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkBlurImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2016-02-16 09:11:18 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-16 09:11:18 -0800
commitafec27f13b28d900232cb1825c63cab2d6e4e103 (patch)
treef16414c3118f2b0eb50a19b10fce60554fee7d33 /src/effects/SkBlurImageFilter.cpp
parent944c2d901c5118abae2262f38414ccb939111355 (diff)
Image filters: change applyCropRect() to take a src rect.
Instead of taking the source bitmap and offset, we simply take the source rect bounds, and make the caller responsible for computing it. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1702683002 Review URL: https://codereview.chromium.org/1702683002
Diffstat (limited to 'src/effects/SkBlurImageFilter.cpp')
-rw-r--r--src/effects/SkBlurImageFilter.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp
index a1d6a2f80e..6ba9e0b640 100644
--- a/src/effects/SkBlurImageFilter.cpp
+++ b/src/effects/SkBlurImageFilter.cpp
@@ -82,8 +82,10 @@ bool SkBlurImageFilter::onFilterImage(Proxy* proxy,
return false;
}
- SkIRect srcBounds, dstBounds;
- if (!this->applyCropRect(this->mapContext(ctx), src, srcOffset, &dstBounds, &srcBounds)) {
+ SkIRect srcBounds = src.bounds();
+ srcBounds.offset(srcOffset);
+ SkIRect dstBounds;
+ if (!this->applyCropRect(this->mapContext(ctx), srcBounds, &dstBounds)) {
return false;
}
if (!srcBounds.intersect(dstBounds)) {
@@ -204,8 +206,10 @@ bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) {
return false;
}
- SkIRect srcBounds, dstBounds;
- if (!this->applyCropRect(this->mapContext(ctx), input, srcOffset, &dstBounds, &srcBounds)) {
+ SkIRect srcBounds = input.bounds();
+ srcBounds.offset(srcOffset);
+ SkIRect dstBounds;
+ if (!this->applyCropRect(this->mapContext(ctx), srcBounds, &dstBounds)) {
return false;
}
if (!srcBounds.intersect(dstBounds)) {