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/ccpr/GrCCDrawPathsOp.cpp b/src/gpu/ccpr/GrCCDrawPathsOp.cpp
index b8c5a01..b1e5ab8 100644
--- a/src/gpu/ccpr/GrCCDrawPathsOp.cpp
+++ b/src/gpu/ccpr/GrCCDrawPathsOp.cpp
@@ -146,18 +146,19 @@
#endif
}
-GrProcessorSet::Analysis GrCCDrawPathsOp::finalize(const GrCaps& caps, const GrAppliedClip* clip,
- GrFSAAType fsaaType, GrClampType clampType) {
+GrProcessorSet::Analysis GrCCDrawPathsOp::finalize(
+ const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
+ GrClampType clampType) {
SkASSERT(1 == fNumDraws); // There should only be one single path draw in this Op right now.
- return fDraws.head().finalize(caps, clip, fsaaType, clampType, &fProcessors);
+ return fDraws.head().finalize(caps, clip, hasMixedSampledCoverage, clampType, &fProcessors);
}
GrProcessorSet::Analysis GrCCDrawPathsOp::SingleDraw::finalize(
- const GrCaps& caps, const GrAppliedClip* clip, GrFSAAType fsaaType, GrClampType clampType,
- GrProcessorSet* processors) {
+ const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage, GrClampType
+ clampType, GrProcessorSet* processors) {
const GrProcessorSet::Analysis& analysis = processors->finalize(
fColor, GrProcessorAnalysisCoverage::kSingleChannel, clip,
- &GrUserStencilSettings::kUnused, fsaaType, caps, clampType, &fColor);
+ &GrUserStencilSettings::kUnused, hasMixedSampledCoverage, caps, clampType, &fColor);
// Lines start looking jagged when they get thinner than 1px. For thin strokes it looks better
// if we can convert them to hairline (i.e., inflate the stroke width to 1px), and instead
diff --git a/src/gpu/ccpr/GrCCDrawPathsOp.h b/src/gpu/ccpr/GrCCDrawPathsOp.h
index f401001..1f95138 100644
--- a/src/gpu/ccpr/GrCCDrawPathsOp.h
+++ b/src/gpu/ccpr/GrCCDrawPathsOp.h
@@ -35,8 +35,8 @@
const char* name() const override { return "GrCCDrawPathsOp"; }
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrFSAAType,
- GrClampType) override;
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
+ bool hasMixedSampledCoverage, GrClampType) override;
CombineResult onCombineIfPossible(GrOp*, const GrCaps&) override;
void visitProxies(const VisitProxyFunc& fn) const override {
for (const auto& range : fInstanceRanges) {
@@ -96,7 +96,8 @@
// See the corresponding methods in GrCCDrawPathsOp.
GrProcessorSet::Analysis finalize(
- const GrCaps&, const GrAppliedClip*, GrFSAAType, GrClampType, GrProcessorSet*);
+ const GrCaps&, const GrAppliedClip*, bool hasMixedSampledCoverage, GrClampType,
+ GrProcessorSet*);
void accountForOwnPath(GrCCPathCache*, GrOnFlushResourceProvider*,
GrCCPerFlushResourceSpecs*);
void setupResources(GrCCPathCache*, GrOnFlushResourceProvider*, GrCCPerFlushResources*,
diff --git a/src/gpu/ccpr/GrCCPerFlushResources.cpp b/src/gpu/ccpr/GrCCPerFlushResources.cpp
index a4ed663..33ac61b 100644
--- a/src/gpu/ccpr/GrCCPerFlushResources.cpp
+++ b/src/gpu/ccpr/GrCCPerFlushResources.cpp
@@ -33,8 +33,8 @@
class AtlasOp : public GrDrawOp {
public:
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- GrProcessorSet::Analysis finalize(
- const GrCaps&, const GrAppliedClip*, GrFSAAType, GrClampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
+ bool hasMixedSampledCoverage, GrClampType) override {
return GrProcessorSet::EmptySetAnalysis();
}
CombineResult onCombineIfPossible(GrOp* other, const GrCaps&) override {
diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
index 95d27c6..55d8a18 100644
--- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
+++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
@@ -59,7 +59,7 @@
GrPathRenderer::CanDrawPath GrCoverageCountingPathRenderer::onCanDrawPath(
const CanDrawPathArgs& args) const {
const GrShape& shape = *args.fShape;
- if (!(AATypeFlags::kCoverage & args.fAATypeFlags) || shape.style().hasPathEffect() ||
+ if (GrAAType::kCoverage != args.fAAType || shape.style().hasPathEffect() ||
args.fViewMatrix->hasPerspective() || shape.inverseFilled()) {
return CanDrawPath::kNo;
}