diff options
author | 2016-07-21 12:04:08 -0700 | |
---|---|---|
committer | 2016-07-21 12:04:08 -0700 | |
commit | 2895eeb11a9f0d9c0018d49dd4bc45f6c6fc062c (patch) | |
tree | 3509c01c16bd72405503e587553820e379b534c5 /src/gpu/batches/GrStencilAndCoverPathRenderer.cpp | |
parent | f25bff95db388554027c78df709f78f8278fffed (diff) |
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
Review-Url: https://codereview.chromium.org/2092893003
Diffstat (limited to 'src/gpu/batches/GrStencilAndCoverPathRenderer.cpp')
-rw-r--r-- | src/gpu/batches/GrStencilAndCoverPathRenderer.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp index 02d74fff6e..52c98930b8 100644 --- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp +++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp @@ -13,7 +13,6 @@ #include "GrDrawPathBatch.h" #include "GrGpu.h" #include "GrPath.h" -#include "GrPipelineBuilder.h" #include "GrRenderTarget.h" #include "GrResourceProvider.h" #include "GrStencilPathBatch.h" @@ -137,14 +136,9 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) { GrRectBatchFactory::CreateNonAAFill(args.fPaint->getColor(), viewM, bounds, nullptr, &invert)); - { - GrPipelineBuilder pipelineBuilder(*args.fPaint, - args.fPaint->isAntiAlias() && - !args.fDrawContext->hasMixedSamples()); - pipelineBuilder.setUserStencil(&kInvertedCoverPass); - - args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, coverBatch); - } + SkASSERT(args.fDrawContext->mustUseHWAA(*args.fPaint) == + (args.fPaint->isAntiAlias() && !args.fDrawContext->hasMixedSamples())); + args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, kInvertedCoverPass, coverBatch); } else { static constexpr GrUserStencilSettings kCoverPass( GrUserStencilSettings::StaticInit< @@ -159,14 +153,9 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) { SkAutoTUnref<GrDrawBatch> batch( GrDrawPathBatch::Create(viewMatrix, args.fPaint->getColor(), p->getFillType(), p)); - 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); + SkASSERT(args.fDrawContext->mustUseHWAA(*args.fPaint) == + (args.fPaint->isAntiAlias() || args.fAntiAlias)); + args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, kCoverPass, batch); } return true; |