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

Unified Diff: src/effects/SkBlurMaskFilter.cpp

Issue 2268583002: Fix Ganesh analytic blurred rect draws (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 years, 4 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 | « no previous file | src/gpu/SkGpuDevice_drawTexture.cpp » ('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 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;
}
« no previous file with comments | « no previous file | src/gpu/SkGpuDevice_drawTexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698