Index: src/gpu/batches/GrStencilAndCoverPathRenderer.cpp |
diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp |
index 52c98930b82b3be9df1bcc47c16d5e1b8d4811f8..02d74fff6e53d49c9e693e806c51e46302ecc033 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 @@ |
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 @@ |
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; |