Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 1962243002: Separate user and raw stencil settings (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 6c80f52bba5c9260e815fed142a708bd1e0708d1..af405a94b8b081e24bb0e8245e09f7e7d45998e2 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -372,7 +372,7 @@ void GrDrawContext::drawRect(const GrClip& clip,
}
bool GrDrawContextPriv::drawAndStencilRect(const SkIRect* scissorRect,
- const GrStencilSettings& ss,
+ const GrUserStencilSettings* ss,
SkRegion::Op op,
bool invert,
bool doAA,
@@ -394,7 +394,7 @@ bool GrDrawContextPriv::drawAndStencilRect(const SkIRect* scissorRect,
GrPipelineBuilder pipelineBuilder(paint,
fDrawContext->accessRenderTarget(),
GrClip::WideOpen());
- pipelineBuilder.setStencil(ss);
+ pipelineBuilder.setUserStencil(ss);
fDrawContext->getDrawTarget()->drawBatch(pipelineBuilder, batch, scissorRect);
return true;
@@ -856,7 +856,7 @@ void GrDrawContext::drawPath(const GrClip& clip,
}
bool GrDrawContextPriv::drawAndStencilPath(const SkIRect* scissorRect,
- const GrStencilSettings& ss,
+ const GrUserStencilSettings* ss,
SkRegion::Op op,
bool invert,
bool doAA,
@@ -881,7 +881,7 @@ bool GrDrawContextPriv::drawAndStencilPath(const SkIRect* scissorRect,
// aa. If we have some future driver-mojo path AA that can do the right
// thing WRT to the blend then we'll need some query on the PR.
bool useCoverageAA = doAA && !fDrawContext->fRenderTarget->isUnifiedMultisampled();
- bool isStencilDisabled = true;
+ bool hasUserStencilSettings = (&GrUserStencilSettings::kUnused != ss);
bool isStencilBufferMSAA = fDrawContext->fRenderTarget->isStencilBufferMultisampled();
const GrPathRendererChain::DrawType type =
@@ -894,7 +894,7 @@ bool GrDrawContextPriv::drawAndStencilPath(const SkIRect* scissorRect,
canDrawArgs.fPath = &path;
canDrawArgs.fStroke = &GrStrokeInfo::FillInfo();
canDrawArgs.fAntiAlias = useCoverageAA;
- canDrawArgs.fIsStencilDisabled = isStencilDisabled;
+ canDrawArgs.fHasUserStencilSettings = hasUserStencilSettings;
canDrawArgs.fIsStencilBufferMSAA = isStencilBufferMSAA;
// Don't allow the SW renderer
@@ -914,7 +914,7 @@ bool GrDrawContextPriv::drawAndStencilPath(const SkIRect* scissorRect,
}
GrPipelineBuilder pipelineBuilder(paint, fDrawContext->accessRenderTarget(), clip);
- pipelineBuilder.setStencil(ss);
+ pipelineBuilder.setUserStencil(ss);
GrPathRenderer::DrawPathArgs args;
args.fTarget = fDrawContext->getDrawTarget();
@@ -944,7 +944,7 @@ void GrDrawContext::internalDrawPath(const GrClip& clip,
// aa. If we have some future driver-mojo path AA that can do the right
// thing WRT to the blend then we'll need some query on the PR.
bool useCoverageAA = should_apply_coverage_aa(paint, fRenderTarget.get());
- const bool isStencilDisabled = true;
+ constexpr bool kHasUserStencilSettings = false;
bool isStencilBufferMSAA = fRenderTarget->isStencilBufferMultisampled();
const GrPathRendererChain::DrawType type =
@@ -961,7 +961,7 @@ void GrDrawContext::internalDrawPath(const GrClip& clip,
canDrawArgs.fPath = pathPtr;
canDrawArgs.fStroke = strokeInfoPtr;
canDrawArgs.fAntiAlias = useCoverageAA;
- canDrawArgs.fIsStencilDisabled = isStencilDisabled;
+ canDrawArgs.fHasUserStencilSettings = kHasUserStencilSettings;
canDrawArgs.fIsStencilBufferMSAA = isStencilBufferMSAA;
// Try a 1st time without stroking the path and without allowing the SW renderer

Powered by Google App Engine
This is Rietveld 408576698