Always trigger DMSAA when there is stencil

This ensures stencil contents get properly preserved between render
passes, if needed.

Bug: skia:11396
Change-Id: Ib4219a5b4cbc7015ec16bb0294e5836c48ac29e4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/415357
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
Chris Dalton 2021-06-03 14:31:59 -06:00 committed by Skia Commit-Bot
parent 7aa7939a60
commit a1a3afe951

View File

@ -1896,6 +1896,17 @@ void GrSurfaceDrawContext::addDrawOp(const GrClip* clip,
GrClampType clampType = GrColorTypeClampType(this->colorInfo().colorType());
GrProcessorSet::Analysis analysis = drawOp->finalize(*this->caps(), &appliedClip, clampType);
// Note if the op needs stencil. Stencil clipping already called setNeedsStencil for itself, if
// needed.
if (drawOp->usesStencil()) {
this->setNeedsStencil();
if (fCanUseDynamicMSAA) {
// Always trigger DMSAA when there is stencil. This ensures stencil contents get
// properly preserved between render passes, if needed.
usesMSAA = true;
}
}
// Must be called before setDstProxyView so that it sees the final bounds of the op.
op->setClippedBounds(bounds);
@ -1906,12 +1917,6 @@ void GrSurfaceDrawContext::addDrawOp(const GrClip* clip,
}
}
// Note if the op needs stencil. Stencil clipping already called setNeedsStencil for itself, if
// needed.
if (drawOp->usesStencil()) {
this->setNeedsStencil();
}
auto opsTask = this->getOpsTask();
if (willAddFn) {
willAddFn(op.get(), opsTask->uniqueID());