aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkBlurMaskFilter.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-01-30 09:14:04 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-30 14:51:30 +0000
commitd0dc05b98b71af43b44f13beba1292db52b75539 (patch)
tree8f99420762c16a6416857d6a9fc3f49436736013 /src/effects/SkBlurMaskFilter.cpp
parentb53f4fa0824613bf0a8eb2d712a9e918327e5bc4 (diff)
Make blur utils take GrTextureProxies
Change-Id: I1c5054de6d9827eece2f73c4c78818b4db0bc611 Reviewed-on: https://skia-review.googlesource.com/7738 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/effects/SkBlurMaskFilter.cpp')
-rw-r--r--src/effects/SkBlurMaskFilter.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index bf544077df..594a94e300 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -1135,12 +1135,12 @@ static sk_sp<GrTexture> find_or_create_rrect_blur_mask(GrContext* context,
rtc->drawRRect(GrNoClip(), std::move(paint), GrAA::kYes, SkMatrix::I(), rrectToDraw,
GrStyle::SimpleFill());
- sk_sp<GrTexture> srcTexture(rtc->asTexture());
- if (!srcTexture) {
+ sk_sp<GrTextureProxy> srcProxy(sk_ref_sp(rtc->asDeferredTexture()));
+ if (!srcProxy) {
return nullptr;
}
sk_sp<GrRenderTargetContext> rtc2(SkGpuBlurUtils::GaussianBlur(context,
- srcTexture.get(),
+ std::move(srcProxy),
nullptr,
SkIRect::MakeWH(
size.fWidth,
@@ -1498,16 +1498,11 @@ sk_sp<GrTextureProxy> SkBlurMaskFilterImpl::filterMaskGPU(GrContext* context,
SkScalar xformedSigma = this->computeXformedSigma(ctm);
SkASSERT(xformedSigma > 0);
- // TODO: defer this further (i.e., push the proxy into GaussianBlur)
- GrTexture* src = srcProxy->instantiate(context->textureProvider());
- if (!src) {
- return nullptr;
- }
-
// 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);
- sk_sp<GrRenderTargetContext> renderTargetContext(SkGpuBlurUtils::GaussianBlur(context, src,
+ sk_sp<GrRenderTargetContext> renderTargetContext(SkGpuBlurUtils::GaussianBlur(context,
+ srcProxy,
nullptr, clipRect,
nullptr,
xformedSigma,
@@ -1520,7 +1515,7 @@ sk_sp<GrTextureProxy> SkBlurMaskFilterImpl::filterMaskGPU(GrContext* context,
GrPaint paint;
// Blend pathTexture over blurTexture.
paint.addCoverageFragmentProcessor(
- GrSimpleTextureEffect::Make(src, nullptr, SkMatrix::I()));
+ GrSimpleTextureEffect::Make(context, std::move(srcProxy), nullptr, SkMatrix::I()));
if (kInner_SkBlurStyle == fBlurStyle) {
// inner: dst = dst * src
paint.setCoverageSetOpXPFactory(SkRegion::kIntersect_Op);