Index: src/effects/SkBlurMaskFilter.cpp |
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp |
index cbaed9b66903a22ba7b0f906c47ddb3fc560a0c5..d2781dbe41d70e1039c88b09f642d1e89c2b84d6 100644 |
--- a/src/effects/SkBlurMaskFilter.cpp |
+++ b/src/effects/SkBlurMaskFilter.cpp |
@@ -1158,7 +1158,7 @@ static sk_sp<GrTexture> find_or_create_rrect_blur_mask(GrContext* context, |
sk_sp<GrFragmentProcessor> GrRRectBlurEffect::Make(GrContext* context, |
float sigma, float xformedSigma, |
const SkRRect& srcRRect, const SkRRect& devRRect) { |
- SkASSERT(!devRRect.isCircle()); // Should've been caught up-stream |
+ SkASSERT(!devRRect.isCircle() && !devRRect.isRect()); // Should've been caught up-stream |
// TODO: loosen this up |
if (!devRRect.isSimpleCircular()) { |
@@ -1351,11 +1351,23 @@ bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrContext* context, |
SkScalar xformedSigma = this->computeXformedSigma(viewMatrix); |
- if (devRRect.isCircle()) { |
- sk_sp<GrFragmentProcessor> fp(GrCircleBlurFragmentProcessor::Make( |
- context->textureProvider(), |
- devRRect.rect(), |
- xformedSigma)); |
+ if (devRRect.isRect() || devRRect.isCircle()) { |
+ if (this->ignoreXform()) { |
+ return false; |
+ } |
+ |
+ sk_sp<GrFragmentProcessor> fp; |
+ if (devRRect.isRect()) { |
+ SkScalar pad = 3.0f * xformedSigma; |
+ const SkRect dstCoverageRect = devRRect.rect().makeOutset(pad, pad); |
+ |
+ fp = GrRectBlurEffect::Make(context->textureProvider(), dstCoverageRect, xformedSigma); |
+ } else { |
+ fp = GrCircleBlurFragmentProcessor::Make(context->textureProvider(), |
+ devRRect.rect(), |
+ xformedSigma); |
+ } |
+ |
if (!fp) { |
return false; |
} |