aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkBlurImageFilter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/effects/SkBlurImageFilter.cpp')
-rw-r--r--src/effects/SkBlurImageFilter.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp
index adcb28f90d..ffebe54225 100644
--- a/src/effects/SkBlurImageFilter.cpp
+++ b/src/effects/SkBlurImageFilter.cpp
@@ -146,15 +146,13 @@ bool SkBlurImageFilter::onFilterImage(Proxy* proxy,
return false;
}
- SkAutoLockPixels alp(src);
- if (!src.getPixels()) {
+ SkIRect srcBounds, dstBounds;
+ if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &srcBounds, &src)) {
return false;
}
- SkIRect srcBounds, dstBounds;
- src.getBounds(&srcBounds);
- srcBounds.offset(srcOffset);
- if (!this->applyCropRect(&srcBounds, ctx.ctm())) {
+ SkAutoLockPixels alp(src);
+ if (!src.getPixels()) {
return false;
}
@@ -258,13 +256,11 @@ bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
if (getInput(0) && !getInput(0)->getInputResultGPU(proxy, src, ctx, &input, &srcOffset)) {
return false;
}
- GrTexture* source = input.getTexture();
SkIRect rect;
- src.getBounds(&rect);
- rect.offset(srcOffset);
- if (!this->applyCropRect(&rect, ctx.ctm())) {
+ if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &rect, &input)) {
return false;
}
+ GrTexture* source = input.getTexture();
SkVector sigma, localSigma = SkVector::Make(fSigma.width(), fSigma.height());
ctx.ctm().mapVectors(&sigma, &localSigma, 1);
offset->fX = rect.fLeft;