From da135c397356c75d6d0d990945b748d37eae6121 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Thu, 16 Aug 2018 14:48:48 -0400 Subject: [PATCH] Make directFilterMaskGPU & directFilterRRectMaskGPU no longer require canFilterMaskGPU's permission This changes the following GMs: drawlooper rects blurrects for the GPU configs Change-Id: Ia13a457d9c5e350463065622c72c660146079998 Reviewed-on: https://skia-review.googlesource.com/147562 Reviewed-by: Brian Osman Commit-Queue: Robert Phillips --- src/core/SkBlurMF.cpp | 3 +++ src/gpu/GrBlurUtils.cpp | 24 ++++++++++++------------ src/gpu/SkGpuDevice.cpp | 11 ++++------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/core/SkBlurMF.cpp b/src/core/SkBlurMF.cpp index 825264f2b7..f0410490b0 100644 --- a/src/core/SkBlurMF.cpp +++ b/src/core/SkBlurMF.cpp @@ -805,6 +805,9 @@ bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrContext* context, GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider(); SkScalar xformedSigma = this->computeXformedSigma(viewMatrix); + if (xformedSigma <= 0) { + return false; + } if (devRRect.isRect() || SkRRectPriv::IsCircle(devRRect)) { std::unique_ptr fp; diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp index 4d527cb831..7ebb2568b9 100644 --- a/src/gpu/GrBlurUtils.cpp +++ b/src/gpu/GrBlurUtils.cpp @@ -198,6 +198,18 @@ static void draw_path_with_mask_filter(GrContext* context, pathIsMutable = true; } + if (maskFilter->directFilterMaskGPU(context, + renderTargetContext, + std::move(paint), + clip, + viewMatrix, + SkStrokeRec(fillOrHairline), + *path)) { + // the mask filter was able to draw itself directly, so there's nothing + // left to do. + return; + } + SkRect maskRect; if (maskFilter->canFilterMaskGPU(SkRRect::MakeRect(path->getBounds()), clipBounds, @@ -213,18 +225,6 @@ static void draw_path_with_mask_filter(GrContext* context, return; } - if (maskFilter->directFilterMaskGPU(context, - renderTargetContext, - std::move(paint), - clip, - viewMatrix, - SkStrokeRec(fillOrHairline), - *path)) { - // the mask filter was able to draw itself directly, so there's nothing - // left to do. - return; - } - sk_sp maskProxy(create_mask_GPU(context, finalIRect, *path, diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 6c3bd0a321..b6b03a2c74 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -423,14 +423,11 @@ void SkGpuDevice::drawRRect(const SkRRect& rrect, const SkPaint& paint) { SkRRect devRRect; if (rrect.transform(this->ctm(), &devRRect)) { if (SkRRectPriv::AllCornersCircular(devRRect)) { - if (mf->canFilterMaskGPU(devRRect, this->devClipBounds(), this->ctm(), nullptr)) { - if (mf->directFilterRRectMaskGPU(this->context(), fRenderTargetContext.get(), - std::move(grPaint), this->clip(), this->ctm(), - style.strokeRec(), rrect, devRRect)) { - return; - } + if (mf->directFilterRRectMaskGPU(this->context(), fRenderTargetContext.get(), + std::move(grPaint), this->clip(), this->ctm(), + style.strokeRec(), rrect, devRRect)) { + return; } - } } }