aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
diff options
context:
space:
mode:
authorGravatar csmartdalton <csmartdalton@google.com>2016-08-12 15:11:51 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-12 15:11:51 -0700
commit5c6fc4fbfd425a91bbb9cd493517bd3c9aa6ad55 (patch)
treee80776aae2b6dea8537325319faabe844e200956 /src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
parentca39d716f10e75e3a2449262e67584f46d589c26 (diff)
Remove stencil settings param from stencilPath()
stencilPath() picks its own user stencil settings. This argument should not be there. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241873002 Review-Url: https://codereview.chromium.org/2241873002
Diffstat (limited to 'src/gpu/batches/GrStencilAndCoverPathRenderer.cpp')
-rw-r--r--src/gpu/batches/GrStencilAndCoverPathRenderer.cpp39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
index 02d74fff6e..5d280efac2 100644
--- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
@@ -76,8 +76,7 @@ void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) {
args.fShape->asPath(&path);
SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, path, GrStyle::SimpleFill()));
- args.fDrawContext->drawContextPriv().stencilPath(*args.fClip, nullptr, args.fIsAA,
- *args.fViewMatrix, p);
+ args.fDrawContext->drawContextPriv().stencilPath(*args.fClip, args.fIsAA, *args.fViewMatrix, p);
}
bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
@@ -94,25 +93,6 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, path, args.fShape->style()));
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>()
- );
-
- // fake inverse with a stencil and cover
- args.fDrawContext->drawContextPriv().stencilPath(*args.fClip,
- &kInvertedCoverPass,
- args.fPaint->isAntiAlias(),
- viewMatrix, p);
-
SkMatrix invert = SkMatrix::I();
SkRect bounds =
SkRect::MakeLTRB(0, 0,
@@ -137,7 +117,24 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
GrRectBatchFactory::CreateNonAAFill(args.fPaint->getColor(), viewM, bounds,
nullptr, &invert));
+ // fake inverse with a stencil and cover
+ args.fDrawContext->drawContextPriv().stencilPath(*args.fClip, args.fPaint->isAntiAlias(),
+ viewMatrix, p);
+
{
+ 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>()
+ );
+
GrPipelineBuilder pipelineBuilder(*args.fPaint,
args.fPaint->isAntiAlias() &&
!args.fDrawContext->hasMixedSamples());