Eliminate mixed samples as an FBO type or AA type
From now on, sample counts always refer to the number of actual color
samples, and render targets don't have separate color and stencil
sample counts.
If mixed samples support is available when making a
"GrAAType::kCoverage" draw, then an op may attach and use a mixed
sampled stencil buffer internally. But this will all be invisible to
the client.
After this CL, we temporarily won't have a mode to use nvpr with mixed
samples. That will soon be fixed by a follow-on CL that enables nvpr
with mixed samples in the normal "gl" and "gles" configs.
Bug: skia:
Change-Id: I1cb8277f0d2d0d371f24bb9f39cd473ed5c5c83b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221878
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp b/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp
index 511599c..58f1037 100644
--- a/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp
@@ -44,8 +44,8 @@
if (args.fHasUserStencilSettings) {
return CanDrawPath::kNo;
}
- // doesn't do per-path AA, relies on the target having MSAA.
- if (AATypeFlags::kCoverage == args.fAATypeFlags) {
+ // We rely on a mixed sampled stencil buffer to implement coverage AA.
+ if (GrAAType::kCoverage == args.fAAType) { // MIXED SAMPLES TODO: "&& !mixedSamplesSupport"
return CanDrawPath::kNo;
}
return CanDrawPath::kYes;
@@ -91,12 +91,14 @@
const SkMatrix& viewMatrix = *args.fViewMatrix;
- bool doStencilMSAA = AATypeFlags::kNone != args.fAATypeFlags;
- SkASSERT(!doStencilMSAA ||
- (AATypeFlags::kMSAA | AATypeFlags::kMixedSampledStencilThenCover) & args.fAATypeFlags);
+ bool doStencilMSAA = GrAAType::kNone != args.fAAType;
sk_sp<GrPath> path(get_gr_path(fResourceProvider, *args.fShape));
+ if (GrAAType::kCoverage == args.fAAType) {
+ // MIXED SAMPLES TODO: Indicate that we need a mixed sampled stencil buffer.
+ }
+
if (args.fShape->inverseFilled()) {
SkMatrix vmi;
if (!viewMatrix.invert(&vmi)) {
@@ -157,12 +159,12 @@
// We have to suppress enabling MSAA for mixed samples or we will get seams due to
// coverage modulation along the edge where two triangles making up the rect meet.
GrAA doStencilMSAA = GrAA::kNo;
- if (AATypeFlags::kMSAA & args.fAATypeFlags) {
- SkASSERT(!(AATypeFlags::kMixedSampledStencilThenCover & args.fAATypeFlags));
+ if (GrAAType::kMSAA == args.fAAType) {
doStencilMSAA = GrAA::kYes;
}
- args.fRenderTargetContext->priv().stencilRect(*args.fClip, &kInvertedCoverPass,
- std::move(args.fPaint), doStencilMSAA, coverMatrix, coverBounds, &localMatrix);
+ args.fRenderTargetContext->priv().stencilRect(
+ *args.fClip, &kInvertedCoverPass, std::move(args.fPaint), doStencilMSAA,
+ coverMatrix, coverBounds, &localMatrix);
}
} else {
std::unique_ptr<GrDrawOp> op = GrDrawPathOp::Make(