diff options
author | 2016-07-22 07:10:19 -0700 | |
---|---|---|
committer | 2016-07-22 07:10:20 -0700 | |
commit | bb24383abb724c516e472af4eec68f2c3f17a6d0 (patch) | |
tree | c5c2225167f7a2441a9a8fef1a53c5a93546cde1 /src/gpu/batches/GrStencilAndCoverPathRenderer.cpp | |
parent | 396fcdba14a0101ed43dcc3863585bf50c4ed6cc (diff) |
Revert of Retract PipelineBuilder some more (patchset #9 id:160001 of https://codereview.chromium.org/2092893003/ )
Reason for revert:
skbug.com/5559
Original issue's description:
> Retract PipelineBuilder some more
>
> The main part of this CL is widening SkDrawContext::drawBatch's API to accept the userStencilSettings & drawFace
>
> There is some ancillary spookiness related to expanding the should_apply_coverage_aa & mustUseHWAA methods to encompass mixedSamples
>
> Calved off:
> https://codereview.chromium.org/2165283002/ (Remove DrawFace enum from GrPipelineBuilder)
> https://codereview.chromium.org/2167183002/ (Minor change to Ganesh path renderers)
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2092893003
>
> Committed: https://skia.googlesource.com/skia/+/2895eeb11a9f0d9c0018d49dd4bc45f6c6fc062c
TBR=robertphillips@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review-Url: https://codereview.chromium.org/2175573004
Diffstat (limited to 'src/gpu/batches/GrStencilAndCoverPathRenderer.cpp')
-rw-r--r-- | src/gpu/batches/GrStencilAndCoverPathRenderer.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp index 52c98930b8..02d74fff6e 100644 --- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp +++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp @@ -13,6 +13,7 @@ #include "GrDrawPathBatch.h" #include "GrGpu.h" #include "GrPath.h" +#include "GrPipelineBuilder.h" #include "GrRenderTarget.h" #include "GrResourceProvider.h" #include "GrStencilPathBatch.h" @@ -136,9 +137,14 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) { GrRectBatchFactory::CreateNonAAFill(args.fPaint->getColor(), viewM, bounds, nullptr, &invert)); - SkASSERT(args.fDrawContext->mustUseHWAA(*args.fPaint) == - (args.fPaint->isAntiAlias() && !args.fDrawContext->hasMixedSamples())); - args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, kInvertedCoverPass, coverBatch); + { + GrPipelineBuilder pipelineBuilder(*args.fPaint, + args.fPaint->isAntiAlias() && + !args.fDrawContext->hasMixedSamples()); + pipelineBuilder.setUserStencil(&kInvertedCoverPass); + + args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, coverBatch); + } } else { static constexpr GrUserStencilSettings kCoverPass( GrUserStencilSettings::StaticInit< @@ -153,9 +159,14 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) { SkAutoTUnref<GrDrawBatch> batch( GrDrawPathBatch::Create(viewMatrix, args.fPaint->getColor(), p->getFillType(), p)); - SkASSERT(args.fDrawContext->mustUseHWAA(*args.fPaint) == - (args.fPaint->isAntiAlias() || args.fAntiAlias)); - args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, kCoverPass, batch); + GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fPaint->isAntiAlias()); + pipelineBuilder.setUserStencil(&kCoverPass); + if (args.fAntiAlias) { + SkASSERT(args.fDrawContext->isStencilBufferMultisampled()); + pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag); + } + + args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); } return true; |