diff options
author | Brian Salomon <bsalomon@google.com> | 2016-12-09 14:06:38 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-09 19:56:24 +0000 |
commit | 3944484020d98ff8f386378296106c321279482b (patch) | |
tree | a77a4a189b715cc544656929d3d3d71be3aca622 /src/gpu/GrBlurUtils.cpp | |
parent | d263413a2a92cafe3fd3b051c67d00206c9a0e4d (diff) |
Reland "Remove antialiasing control from GrPaint."
This contains fixes for GLPrograms test and mixed samples rendering.
This reverts commit 419d81eed4a010e6080db199795117cbedf9e6e4.
BUG=skia:
Change-Id: If8f002fbfaaaab6d1607403f2b15ccc7f1e17e87
Reviewed-on: https://skia-review.googlesource.com/5763
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrBlurUtils.cpp')
-rw-r--r-- | src/gpu/GrBlurUtils.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp index 4d89bef63c..768860525f 100644 --- a/src/gpu/GrBlurUtils.cpp +++ b/src/gpu/GrBlurUtils.cpp @@ -45,8 +45,8 @@ static bool draw_mask(GrRenderTargetContext* renderTargetContext, if (!viewMatrix.invert(&inverse)) { return false; } - renderTargetContext->fillRectWithLocalMatrix(clip, *grp, SkMatrix::I(), SkRect::Make(maskRect), - inverse); + renderTargetContext->fillRectWithLocalMatrix(clip, *grp, GrAA::kNo, SkMatrix::I(), + SkRect::Make(maskRect), inverse); return true; } @@ -98,9 +98,9 @@ static sk_sp<GrTextureProxy> create_mask_GPU(GrContext* context, const SkIRect& maskRect, const SkPath& devPath, SkStrokeRec::InitStyle fillOrHairline, - bool doAA, + GrAA aa, int sampleCnt) { - if (!doAA) { + if (GrAA::kNo == aa) { // Don't need MSAA if mask isn't AA sampleCnt = 0; } @@ -115,7 +115,6 @@ static sk_sp<GrTextureProxy> create_mask_GPU(GrContext* context, rtContext->priv().absClear(nullptr, 0x0); GrPaint tempPaint; - tempPaint.setAntiAlias(doAA); tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op); // setup new clip @@ -126,7 +125,7 @@ static sk_sp<GrTextureProxy> create_mask_GPU(GrContext* context, // the origin using tempPaint. SkMatrix translate; translate.setTranslate(-SkIntToScalar(maskRect.fLeft), -SkIntToScalar(maskRect.fTop)); - rtContext->drawPath(clip, tempPaint, translate, devPath, GrStyle(fillOrHairline)); + rtContext->drawPath(clip, tempPaint, aa, translate, devPath, GrStyle(fillOrHairline)); return sk_ref_sp(rtContext->asDeferredTexture()); } @@ -134,6 +133,7 @@ static void draw_path_with_mask_filter(GrContext* context, GrRenderTargetContext* renderTargetContext, const GrClip& clip, GrPaint* paint, + GrAA aa, const SkMatrix& viewMatrix, const SkMaskFilter* maskFilter, const GrStyle& style, @@ -211,7 +211,7 @@ static void draw_path_with_mask_filter(GrContext* context, finalIRect, *path, fillOrHairline, - paint->isAntiAlias(), + aa, renderTargetContext->numColorSamples())); if (maskProxy) { GrTexture* filtered; @@ -242,11 +242,12 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context, const GrClip& clip, const SkPath& path, GrPaint* paint, + GrAA aa, const SkMatrix& viewMatrix, const SkMaskFilter* mf, const GrStyle& style, bool pathIsMutable) { - draw_path_with_mask_filter(context, renderTargetContext, clip, paint, viewMatrix, mf, + draw_path_with_mask_filter(context, renderTargetContext, clip, paint, aa, viewMatrix, mf, style, &path, pathIsMutable); } @@ -290,14 +291,14 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context, if (!SkPaintToGrPaint(context, renderTargetContext, paint, viewMatrix, &grPaint)) { return; } - + GrAA aa = GrBoolToAA(paint.isAntiAlias()); SkMaskFilter* mf = paint.getMaskFilter(); if (mf && !mf->asFragmentProcessor(nullptr, nullptr, viewMatrix)) { // The MaskFilter wasn't already handled in SkPaintToGrPaint - draw_path_with_mask_filter(context, renderTargetContext, clip, &grPaint, viewMatrix, + draw_path_with_mask_filter(context, renderTargetContext, clip, &grPaint, aa, viewMatrix, mf, style, path, pathIsMutable); } else { - renderTargetContext->drawPath(clip, grPaint, viewMatrix, *path, style); + renderTargetContext->drawPath(clip, grPaint, aa, viewMatrix, *path, style); } } |