ccpr: Add an MSAA atlas mode
Adds the option to use a multisampled (or mixed sampled) atlas, and
uses the sample mask and stencil buffer instead of coverage counts.
Bug: skia:
Change-Id: I9fb76d17895ae25208124f6c27e37977ac31b5eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227428
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/ccpr/GrVSCoverageProcessor.cpp b/src/gpu/ccpr/GrVSCoverageProcessor.cpp
index 1773bec..d58c1b5 100644
--- a/src/gpu/ccpr/GrVSCoverageProcessor.cpp
+++ b/src/gpu/ccpr/GrVSCoverageProcessor.cpp
@@ -444,7 +444,11 @@
SkASSERT(!args.fFPCoordTransformHandler->nextCoordTransform());
// Fragment shader.
- fShader->emitFragmentCode(proc, args.fFragBuilder, args.fOutputColor, args.fOutputCoverage);
+ GrGLSLFPFragmentBuilder* f = args.fFragBuilder;
+ f->codeAppendf("half coverage;");
+ fShader->emitFragmentCoverageCode(f, "coverage");
+ f->codeAppendf("%s = half4(coverage);", args.fOutputColor);
+ f->codeAppendf("%s = half4(1);", args.fOutputCoverage);
}
void GrVSCoverageProcessor::reset(PrimitiveType primitiveType, GrResourceProvider* rp) {
@@ -507,11 +511,8 @@
xyAttribType = kFloat4_GrVertexAttribType;
xySLType = kFloat4_GrSLType;
} else {
- GR_STATIC_ASSERT(offsetof(TriPointInstance, fX) == 0);
- GR_STATIC_ASSERT(sizeof(TriPointInstance::fX) ==
- GrVertexAttribTypeSize(kFloat3_GrVertexAttribType));
- GR_STATIC_ASSERT(sizeof(TriPointInstance::fY) ==
- GrVertexAttribTypeSize(kFloat3_GrVertexAttribType));
+ GR_STATIC_ASSERT(sizeof(TriPointInstance) ==
+ 2 * GrVertexAttribTypeSize(kFloat3_GrVertexAttribType));
xyAttribType = kFloat3_GrVertexAttribType;
xySLType = kFloat3_GrSLType;
}