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

Unified Diff: src/gpu/batches/GrStencilAndCoverPathRenderer.cpp

Issue 2041283002: Replace targetHasUnifiedMultisampling in GrPB constructor (Closed) Base URL: https://skia.googlesource.com/skia.git@fixdash
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « src/gpu/batches/GrPLSPathRenderer.cpp ('k') | src/gpu/batches/GrTessellatingPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
index 1e6675a9a13892e229bcd52d1de2e0cafdd3d4e9..344748ceca6a7eea0473e50e2399deb00ee59a62 100644
--- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
@@ -75,8 +75,7 @@ void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) {
SkSafeUnref(paint.setXPFactory(GrDisableColorXPFactory::Create()));
paint.setAntiAlias(args.fIsAA);
- GrPipelineBuilder pipelineBuilder(paint, args.fDrawContext->isUnifiedMultisampled());
- pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, args.fIsAA);
+ const GrPipelineBuilder pipelineBuilder(paint, args.fIsAA);
SkASSERT(!args.fPath->isInverseFillType());
SkAutoTUnref<GrPath> path(get_gr_path(fResourceProvider, *args.fPath, GrStyle::SimpleFill()));
@@ -90,6 +89,7 @@ void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) {
bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(),
"GrStencilAndCoverPathRenderer::onDrawPath");
+ SkASSERT(!args.fPaint->isAntiAlias() || args.fDrawContext->isStencilBufferMultisampled());
SkASSERT(!args.fStyle->strokeRec().isHairlineStyle());
const SkPath& path = *args.fPath;
const SkMatrix& viewMatrix = *args.fViewMatrix;
@@ -112,13 +112,8 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
// fake inverse with a stencil and cover
{
- GrPipelineBuilder pipelineBuilder(*args.fPaint,
- args.fDrawContext->isUnifiedMultisampled());
+ GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fPaint->isAntiAlias());
pipelineBuilder.setUserStencil(&kInvertedCoverPass);
- if (args.fAntiAlias) {
- SkASSERT(args.fDrawContext->isStencilBufferMultisampled());
- pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag);
- }
args.fDrawContext->drawContextPriv().stencilPath(pipelineBuilder, *args.fClip,
viewMatrix, p, p->getFillType());
@@ -144,23 +139,17 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
}
const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : viewMatrix;
- SkAutoTUnref<GrDrawBatch> batch(
+ SkAutoTUnref<GrDrawBatch> coverBatch(
GrRectBatchFactory::CreateNonAAFill(args.fColor, viewM, bounds, nullptr,
&invert));
{
GrPipelineBuilder pipelineBuilder(*args.fPaint,
- args.fDrawContext->isUnifiedMultisampled());
+ args.fPaint->isAntiAlias() &&
+ !args.fDrawContext->hasMixedSamples());
pipelineBuilder.setUserStencil(&kInvertedCoverPass);
- if (args.fAntiAlias) {
- SkASSERT(args.fDrawContext->isStencilBufferMultisampled());
- pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag);
- }
- if (args.fDrawContext->hasMixedSamples()) {
- pipelineBuilder.disableState(GrPipelineBuilder::kHWAntialias_Flag);
- }
- args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch);
+ args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, coverBatch);
}
} else {
static constexpr GrUserStencilSettings kCoverPass(
@@ -176,8 +165,7 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
SkAutoTUnref<GrDrawBatch> batch(
GrDrawPathBatch::Create(viewMatrix, args.fColor, p->getFillType(), p));
- GrPipelineBuilder pipelineBuilder(*args.fPaint,
- args.fDrawContext->isUnifiedMultisampled());
+ GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fPaint->isAntiAlias());
pipelineBuilder.setUserStencil(&kCoverPass);
if (args.fAntiAlias) {
SkASSERT(args.fDrawContext->isStencilBufferMultisampled());
« no previous file with comments | « src/gpu/batches/GrPLSPathRenderer.cpp ('k') | src/gpu/batches/GrTessellatingPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698