| Index: src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
|
| diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
|
| index 1309dedd4c3c073ed60b5bd51ad964d3fb2be81d..ddba1c871eb1903f4ba2d01e968345d55a6976cc 100644
|
| --- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
|
| +++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
|
| @@ -36,7 +36,7 @@
|
| if (args.fStyle->hasNonDashPathEffect() || args.fStyle->strokeRec().isHairlineStyle()) {
|
| return false;
|
| }
|
| - if (args.fHasUserStencilSettings) {
|
| + if (!args.fIsStencilDisabled) {
|
| return false;
|
| }
|
| if (args.fAntiAlias) {
|
| @@ -80,7 +80,7 @@
|
| GrPipelineBuilder* pipelineBuilder = args.fPipelineBuilder;
|
| const SkMatrix& viewMatrix = *args.fViewMatrix;
|
|
|
| - SkASSERT(!pipelineBuilder->hasUserStencilSettings());
|
| + SkASSERT(pipelineBuilder->getStencil().isDisabled());
|
|
|
| if (args.fAntiAlias) {
|
| SkASSERT(pipelineBuilder->getRenderTarget()->isStencilBufferMultisampled());
|
| @@ -90,21 +90,18 @@
|
| SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, path, *args.fStyle));
|
|
|
| if (path.isInverseFillType()) {
|
| - static constexpr GrUserStencilSettings kInvertedCoverPass(
|
| - GrUserStencilSettings::StaticInit<
|
| - 0x0000,
|
| - // We know our rect will hit pixels outside the clip and the user bits will be 0
|
| - // outside the clip. So we can't just fill where the user bits are 0. We also need
|
| - // to check that the clip bit is set.
|
| - GrUserStencilTest::kEqualIfInClip,
|
| - 0xffff,
|
| - GrUserStencilOp::kKeep,
|
| - GrUserStencilOp::kZero,
|
| - 0xffff>()
|
| - );
|
| + static constexpr GrStencilSettings kInvertedStencilPass(
|
| + kKeep_StencilOp,
|
| + kZero_StencilOp,
|
| + // We know our rect will hit pixels outside the clip and the user bits will be 0
|
| + // outside the clip. So we can't just fill where the user bits are 0. We also need to
|
| + // check that the clip bit is set.
|
| + kEqualIfInClip_StencilFunc,
|
| + 0xffff,
|
| + 0x0000,
|
| + 0xffff);
|
|
|
| -
|
| - pipelineBuilder->setUserStencil(&kInvertedCoverPass);
|
| + pipelineBuilder->setStencil(kInvertedStencilPass);
|
|
|
| // fake inverse with a stencil and cover
|
| args.fTarget->stencilPath(*pipelineBuilder, viewMatrix, p, p->getFillType());
|
| @@ -136,22 +133,20 @@
|
| &invert));
|
| args.fTarget->drawBatch(*pipelineBuilder, batch);
|
| } else {
|
| - static constexpr GrUserStencilSettings kCoverPass(
|
| - GrUserStencilSettings::StaticInit<
|
| - 0x0000,
|
| - GrUserStencilTest::kNotEqual,
|
| - 0xffff,
|
| - GrUserStencilOp::kZero,
|
| - GrUserStencilOp::kKeep,
|
| - 0xffff>()
|
| - );
|
| + static constexpr GrStencilSettings kStencilPass(
|
| + kZero_StencilOp,
|
| + kKeep_StencilOp,
|
| + kNotEqual_StencilFunc,
|
| + 0xffff,
|
| + 0x0000,
|
| + 0xffff);
|
|
|
| - pipelineBuilder->setUserStencil(&kCoverPass);
|
| + pipelineBuilder->setStencil(kStencilPass);
|
| SkAutoTUnref<GrDrawPathBatchBase> batch(
|
| GrDrawPathBatch::Create(viewMatrix, args.fColor, p->getFillType(), p));
|
| args.fTarget->drawPathBatch(*pipelineBuilder, batch);
|
| }
|
|
|
| - pipelineBuilder->disableUserStencil();
|
| + pipelineBuilder->stencil()->setDisabled();
|
| return true;
|
| }
|
|
|