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

Unified Diff: src/effects/SkBlurMaskFilter.cpp

Issue 1962903003: Make SkGpuBlurUtils::GaussianBlur more drawContext centric (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix sk_sp bug Created 4 years, 7 months 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 | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkGpuBlurUtils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBlurMaskFilter.cpp
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index 37d6c960d7829e15d444bbf4cae70ddab053916c..a2d67d74af7b95344ef5d122decf0bfe22ced499 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -1248,10 +1248,11 @@ bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src,
// If we're doing a normal blur, we can clobber the pathTexture in the
// gaussianBlur. Otherwise, we need to save it for later compositing.
bool isNormalBlur = (kNormal_SkBlurStyle == fBlurStyle);
- *result = SkGpuBlurUtils::GaussianBlur(context, src, isNormalBlur && canOverwriteSrc,
- clipRect, nullptr,
- xformedSigma, xformedSigma);
- if (nullptr == *result) {
+ sk_sp<GrDrawContext> drawContext(SkGpuBlurUtils::GaussianBlur(context, src,
+ isNormalBlur && canOverwriteSrc,
+ clipRect, nullptr,
+ xformedSigma, xformedSigma));
+ if (!drawContext) {
return false;
}
@@ -1276,15 +1277,10 @@ bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src,
paint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op);
}
- sk_sp<GrDrawContext> drawContext(
- context->drawContext(sk_ref_sp((*result)->asRenderTarget())));
- if (!drawContext) {
- return false;
- }
-
drawContext->drawRect(GrClip::WideOpen(), paint, SkMatrix::I(), clipRect);
}
+ *result = drawContext->asTexture().release();
return true;
}
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkGpuBlurUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698