Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: src/effects/SkBlurImageFilter.cpp

Issue 1431593002: Make SkBlurImageFilter capable of cropping during blur (GPU path). (Closed) Base URL: senorblanco-linux.mon:src/skia@blur-applyCropRect4-separate-loops
Patch Set: Fix uninitialized bounds in convolve_gaussian_2d() Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBlurImageFilter.cpp
diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp
index 3f4c852c12b887e7316bbd4129124d0ca332a83b..928793de62fcf0b2013af246a197a1193cf76a40 100644
--- a/src/effects/SkBlurImageFilter.cpp
+++ b/src/effects/SkBlurImageFilter.cpp
@@ -205,28 +205,30 @@ bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) {
return false;
}
- SkIRect rect;
- if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &rect, &input)) {
+ SkIRect srcBounds, dstBounds;
+ if (!this->applyCropRect(ctx, input, srcOffset, &dstBounds, &srcBounds)) {
return false;
}
GrTexture* source = input.getTexture();
SkVector sigma = mapSigma(fSigma, ctx.ctm());
- offset->fX = rect.fLeft;
- offset->fY = rect.fTop;
- rect.offset(-srcOffset);
+ offset->fX = dstBounds.fLeft;
+ offset->fY = dstBounds.fTop;
+ srcBounds.offset(-srcOffset);
+ dstBounds.offset(-srcOffset);
+ SkRect srcBoundsF(SkRect::Make(srcBounds));
auto constraint = GrTextureProvider::FromImageFilter(ctx.sizeConstraint());
SkAutoTUnref<GrTexture> tex(SkGpuBlurUtils::GaussianBlur(source->getContext(),
source,
false,
- SkRect::Make(rect),
- true,
+ SkRect::Make(dstBounds),
+ &srcBoundsF,
sigma.x(),
sigma.y(),
constraint));
if (!tex) {
return false;
}
- WrapTexture(tex, rect.width(), rect.height(), result);
+ WrapTexture(tex, dstBounds.width(), dstBounds.height(), result);
return true;
#else
SkDEBUGFAIL("Should not call in GPU-less build");
« no previous file with comments | « no previous file | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698