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 <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2018-08-16 14:48:48 -04:00 committed by Skia Commit-Bot
parent bc414ed5de
commit da135c3973
3 changed files with 19 additions and 19 deletions

View File

@ -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<GrFragmentProcessor> fp;

View File

@ -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<GrTextureProxy> maskProxy(create_mask_GPU(context,
finalIRect,
*path,

View File

@ -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;
}
}
}
}