diff options
author | Brian Salomon <bsalomon@google.com> | 2016-12-09 20:02:08 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-09 20:02:22 +0000 |
commit | 073285c0595d46205d1482cc19af2d7d891bfeae (patch) | |
tree | f127dd2c03ef707cd47396be0bf1cbf911403849 /src/gpu/GrBlurUtils.cpp | |
parent | 3944484020d98ff8f386378296106c321279482b (diff) |
Revert "Reland "Remove antialiasing control from GrPaint.""
This reverts commit 3944484020d98ff8f386378296106c321279482b.
Reason for revert: Merges badly with a recent change. Will rebase and reland.
Original change's description:
> 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>
>
TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org
BUG=skia:
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: Iff9657041e28604a845bc5a9acec7c9b248c53bd
Reviewed-on: https://skia-review.googlesource.com/5772
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrBlurUtils.cpp')
-rw-r--r-- | src/gpu/GrBlurUtils.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp index 768860525f..4d89bef63c 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, GrAA::kNo, SkMatrix::I(), - SkRect::Make(maskRect), inverse); + renderTargetContext->fillRectWithLocalMatrix(clip, *grp, 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, - GrAA aa, + bool doAA, int sampleCnt) { - if (GrAA::kNo == aa) { + if (!doAA) { // Don't need MSAA if mask isn't AA sampleCnt = 0; } @@ -115,6 +115,7 @@ 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 @@ -125,7 +126,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, aa, translate, devPath, GrStyle(fillOrHairline)); + rtContext->drawPath(clip, tempPaint, translate, devPath, GrStyle(fillOrHairline)); return sk_ref_sp(rtContext->asDeferredTexture()); } @@ -133,7 +134,6 @@ 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, - aa, + paint->isAntiAlias(), renderTargetContext->numColorSamples())); if (maskProxy) { GrTexture* filtered; @@ -242,12 +242,11 @@ 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, aa, viewMatrix, mf, + draw_path_with_mask_filter(context, renderTargetContext, clip, paint, viewMatrix, mf, style, &path, pathIsMutable); } @@ -291,14 +290,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, aa, viewMatrix, + draw_path_with_mask_filter(context, renderTargetContext, clip, &grPaint, viewMatrix, mf, style, path, pathIsMutable); } else { - renderTargetContext->drawPath(clip, grPaint, aa, viewMatrix, *path, style); + renderTargetContext->drawPath(clip, grPaint, viewMatrix, *path, style); } } |