Delete mixed samples
Mixed samples is no longer relevant for Ganesh. DMSAA and the new
Ganesh architecture both rely on full MSAA, and any platform where
mixed samples is supported will ultimately not use the old
architecture.
Change-Id: I5acc745010e090ef26310d92ec6240be2cd494cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399837
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 448d7e4..842934d 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -10,6 +10,10 @@
SkRuntimeEffect.
https://review.skia.org/398222
+ * Dropped support for mixed samples. Mixed samples is no longer relevant for Ganesh. DMSAA and the
+ new Ganesh architecture both rely on full MSAA, and any platform where mixed samples is
+ supported will ultimately not use the old architecture.
+
* * *
Milestone 91
diff --git a/bench/VertexColorSpaceBench.cpp b/bench/VertexColorSpaceBench.cpp
index 480e3d4..9f4dce2 100644
--- a/bench/VertexColorSpaceBench.cpp
+++ b/bench/VertexColorSpaceBench.cpp
@@ -160,8 +160,7 @@
return FixedFunctionFlags::kNone;
}
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override {
return GrProcessorSet::EmptySetAnalysis();
}
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index 6c3bd32..00e0794 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -60,11 +60,10 @@
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ const GrCaps& caps, const GrAppliedClip* clip, GrClampType clampType) override {
return fProcessorSet.finalize(
fColor, GrProcessorAnalysisCoverage::kSingleChannel, clip,
- &GrUserStencilSettings::kUnused, hasMixedSampledCoverage, caps, clampType, &fColor);
+ &GrUserStencilSettings::kUnused, caps, clampType, &fColor);
}
void visitProxies(const VisitProxyFunc& func) const override {
diff --git a/gm/clockwise.cpp b/gm/clockwise.cpp
index bec51c2..0958d20 100644
--- a/gm/clockwise.cpp
+++ b/gm/clockwise.cpp
@@ -151,8 +151,7 @@
const char* name() const override { return "ClockwiseTestOp"; }
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override {
return GrProcessorSet::EmptySetAnalysis();
}
diff --git a/gm/fwidth_squircle.cpp b/gm/fwidth_squircle.cpp
index 53c1b8e..2a997e8 100644
--- a/gm/fwidth_squircle.cpp
+++ b/gm/fwidth_squircle.cpp
@@ -160,8 +160,7 @@
const char* name() const override { return "FwidthSquircleTestOp"; }
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override {
return GrProcessorSet::EmptySetAnalysis();
}
diff --git a/gm/tessellation.cpp b/gm/tessellation.cpp
index e27fa42..84bf7c1 100644
--- a/gm/tessellation.cpp
+++ b/gm/tessellation.cpp
@@ -313,8 +313,7 @@
private:
const char* name() const override { return "TessellationTestOp"; }
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override {
return GrProcessorSet::EmptySetAnalysis();
}
diff --git a/include/gpu/GrContextOptions.h b/include/gpu/GrContextOptions.h
index 2f1a45f..9d19495 100644
--- a/include/gpu/GrContextOptions.h
+++ b/include/gpu/GrContextOptions.h
@@ -239,8 +239,8 @@
ShaderErrorHandler* fShaderErrorHandler = nullptr;
/**
- * Specifies the number of samples Ganesh should use when performing internal draws with MSAA or
- * mixed samples (hardware capabilities permitting).
+ * Specifies the number of samples Ganesh should use when performing internal draws with MSAA
+ * (hardware capabilities permitting).
*
* If 0, Ganesh will disable internal code paths that use multisampling.
*/
diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h
index 5d3d05f..a8f782d 100644
--- a/include/private/GrTypesPriv.h
+++ b/include/private/GrTypesPriv.h
@@ -215,7 +215,7 @@
enum class GrAAType : unsigned {
/** No antialiasing */
kNone,
- /** Use fragment shader code or mixed samples to blend with a fractional pixel coverage. */
+ /** Use fragment shader code to blend with a fractional pixel coverage. */
kCoverage,
/** Use normal MSAA. */
kMSAA,
diff --git a/samplecode/SampleTessellatedWedge.cpp b/samplecode/SampleTessellatedWedge.cpp
index 21e6d9c..b46d8f8 100644
--- a/samplecode/SampleTessellatedWedge.cpp
+++ b/samplecode/SampleTessellatedWedge.cpp
@@ -71,8 +71,6 @@
error = "GPU Only.";
} else if (!ctx->priv().caps()->drawInstancedSupport()) {
error = "Instanced rendering not supported.";
- } else if (sdc->numSamples() == 1 && !ctx->priv().caps()->mixedSamplesSupport()) {
- error = "MSAA/mixed samples only.";
}
if (!error.isEmpty()) {
SkFont font(nullptr, 20);
@@ -88,8 +86,6 @@
GrAAType aa;
if (sdc->numSamples() > 1) {
aa = GrAAType::kMSAA;
- } else if (sdc->asRenderTargetProxy()->canUseMixedSamples(*ctx->priv().caps())) {
- aa = GrAAType::kCoverage;
} else {
aa = GrAAType::kNone;
}
diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp
index a450c7a..3591ca0 100644
--- a/src/gpu/GrCaps.cpp
+++ b/src/gpu/GrCaps.cpp
@@ -30,7 +30,6 @@
fDrawInstancedSupport = false;
fNativeDrawIndirectSupport = false;
fUseClientSideIndirectBuffers = false;
- fMixedSamplesSupport = false;
fConservativeRasterSupport = false;
fWireframeSupport = false;
fMSAAResolvesAutomatically = false;
@@ -92,12 +91,6 @@
}
void GrCaps::finishInitialization(const GrContextOptions& options) {
- if (fMixedSamplesSupport) {
- // We need multisample disable and dual source blending in order to support mixed samples.
- fMixedSamplesSupport = this->multisampleDisableSupport() &&
- this->shaderCaps()->dualSourceBlendingSupport();
- }
-
if (!fNativeDrawIndirectSupport) {
// We will implement indirect draws with a polyfill, so the commands need to reside in CPU
// memory.
@@ -137,11 +130,6 @@
fMaxTextureSize = std::min(fMaxTextureSize, options.fMaxTextureSizeOverride);
#if GR_TEST_UTILS
- if (options.fSuppressDualSourceBlending) {
- // GrShaderCaps::applyOptionsOverrides already handled the rest; here we just need to make
- // sure mixed samples gets disabled if dual source blending is suppressed.
- fMixedSamplesSupport = false;
- }
if (options.fClearAllTextures) {
fShouldInitializeTextures = true;
}
@@ -211,7 +199,6 @@
writer->appendBool("Draw Instanced Support", fDrawInstancedSupport);
writer->appendBool("Native Draw Indirect Support", fNativeDrawIndirectSupport);
writer->appendBool("Use client side indirect buffers", fUseClientSideIndirectBuffers);
- writer->appendBool("Mixed Samples Support", fMixedSamplesSupport);
writer->appendBool("Conservative Raster Support", fConservativeRasterSupport);
writer->appendBool("Wireframe Support", fWireframeSupport);
writer->appendBool("MSAA Resolves Automatically", fMSAAResolvesAutomatically);
@@ -262,8 +249,7 @@
writer->appendS32("Max Render Target Size", fMaxRenderTargetSize);
writer->appendS32("Max Preferred Render Target Size", fMaxPreferredRenderTargetSize);
writer->appendS32("Max Window Rectangles", fMaxWindowRectangles);
- writer->appendS32("Preferred Sample Count for Internal MSAA and Mixed Samples",
- fInternalMultisampleCount);
+ writer->appendS32("Sample Count for Internal MSAA", fInternalMultisampleCount);
static const char* kBlendEquationSupportNames[] = {
"Basic",
diff --git a/src/gpu/GrCaps.h b/src/gpu/GrCaps.h
index a12dc99..3ee740d 100644
--- a/src/gpu/GrCaps.h
+++ b/src/gpu/GrCaps.h
@@ -67,7 +67,6 @@
#endif
return fUseClientSideIndirectBuffers;
}
- bool mixedSamplesSupport() const { return fMixedSamplesSupport; }
bool conservativeRasterSupport() const { return fConservativeRasterSupport; }
bool wireframeSupport() const { return fWireframeSupport; }
// This flag indicates that we never have to resolve MSAA. In practice, it means that we have
@@ -204,7 +203,7 @@
int maxWindowRectangles() const { return fMaxWindowRectangles; }
- // Returns whether mixed samples is supported for the given backend render target.
+ // Returns whether window rectangles are supported for the given backend render target.
bool isWindowRectanglesSupportedForRT(const GrBackendRenderTarget& rt) const {
return this->maxWindowRectangles() > 0 && this->onIsWindowRectanglesSupportedForRT(rt);
}
@@ -225,8 +224,8 @@
// 1 means the format is renderable but doesn't support MSAA.
virtual int maxRenderTargetSampleCount(const GrBackendFormat&) const = 0;
- // Returns the number of samples to use when performing internal draws to the given config with
- // MSAA or mixed samples. If 0, Ganesh should not attempt to use internal multisampling.
+ // Returns the number of samples to use when performing draws to the given config with internal
+ // MSAA. If 0, Ganesh should not attempt to use internal multisampling.
int internalMultisampleCount(const GrBackendFormat& format) const {
return std::min(fInternalMultisampleCount, this->maxRenderTargetSampleCount(format));
}
@@ -503,7 +502,6 @@
bool fDrawInstancedSupport : 1;
bool fNativeDrawIndirectSupport : 1;
bool fUseClientSideIndirectBuffers : 1;
- bool fMixedSamplesSupport : 1;
bool fConservativeRasterSupport : 1;
bool fWireframeSupport : 1;
bool fMSAAResolvesAutomatically : 1;
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 66676a9..644bfc4 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -272,7 +272,6 @@
SkASSERT(rtIBounds.contains(scissor)); // Mask shouldn't be larger than the RT.
#endif
- // MIXED SAMPLES TODO: We may want to explore using the stencil buffer for AA clipping.
if ((surfaceDrawContext->numSamples() <= 1 && reducedClip.maskRequiresAA()) ||
context->priv().caps()->avoidStencilBuffers() ||
surfaceDrawContext->wrapsVkSecondaryCB()) {
diff --git a/src/gpu/GrDynamicAtlas.cpp b/src/gpu/GrDynamicAtlas.cpp
index d468c12..2e2ab33 100644
--- a/src/gpu/GrDynamicAtlas.cpp
+++ b/src/gpu/GrDynamicAtlas.cpp
@@ -56,7 +56,7 @@
GrBackendFormat format = caps.getDefaultBackendFormat(colorType, GrRenderable::kYes);
int sampleCount = 1;
- if (!caps.mixedSamplesSupport() && InternalMultisample::kYes == internalMultisample) {
+ if (InternalMultisample::kYes == internalMultisample) {
sampleCount = caps.internalMultisampleCount(format);
}
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 498668c..d2ae543 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -606,8 +606,7 @@
// Returns nullptr if compatible sb could not be created, otherwise the caller owns the ref on
// the GrAttachment.
virtual sk_sp<GrAttachment> makeStencilAttachmentForRenderTarget(const GrRenderTarget*,
- SkISize dimensions,
- int numStencilSamples) = 0;
+ SkISize dimensions) = 0;
virtual GrBackendFormat getPreferredStencilFormat(const GrBackendFormat&) = 0;
diff --git a/src/gpu/GrOpsTask.cpp b/src/gpu/GrOpsTask.cpp
index bc489c9..d2c07f5 100644
--- a/src/gpu/GrOpsTask.cpp
+++ b/src/gpu/GrOpsTask.cpp
@@ -562,17 +562,14 @@
SkASSERT(renderTarget);
GrAttachment* stencil = nullptr;
- if (int numStencilSamples = proxy->numStencilSamples()) {
- if (!flushState->resourceProvider()->attachStencilAttachment(
- renderTarget, numStencilSamples)) {
+ if (proxy->needsStencil()) {
+ if (!flushState->resourceProvider()->attachStencilAttachment(renderTarget)) {
SkDebugf("WARNING: failed to attach a stencil buffer. Rendering will be skipped.\n");
return false;
}
stencil = renderTarget->getStencilAttachment();
}
- SkASSERT(!stencil || stencil->numSamples() == proxy->numStencilSamples());
-
GrLoadOp stencilLoadOp;
switch (fInitialStencilContent) {
case StencilContent::kDontCare:
diff --git a/src/gpu/GrProcessorSet.cpp b/src/gpu/GrProcessorSet.cpp
index ff2361b..2c44439 100644
--- a/src/gpu/GrProcessorSet.cpp
+++ b/src/gpu/GrProcessorSet.cpp
@@ -115,8 +115,7 @@
GrProcessorSet::Analysis GrProcessorSet::finalize(
const GrProcessorAnalysisColor& colorInput, const GrProcessorAnalysisCoverage coverageInput,
const GrAppliedClip* clip, const GrUserStencilSettings* userStencil,
- bool hasMixedSampledCoverage, const GrCaps& caps, GrClampType clampType,
- SkPMColor4f* overrideInputColor) {
+ const GrCaps& caps, GrClampType clampType, SkPMColor4f* overrideInputColor) {
SkASSERT(!this->isFinalized());
GrProcessorSet::Analysis analysis;
@@ -153,8 +152,7 @@
}
GrXPFactory::AnalysisProperties props = GrXPFactory::GetAnalysisProperties(
- this->xpFactory(), colorAnalysis.outputColor(), outputCoverage, hasMixedSampledCoverage,
- caps, clampType);
+ this->xpFactory(), colorAnalysis.outputColor(), outputCoverage, caps, clampType);
analysis.fRequiresDstTexture =
SkToBool(props & GrXPFactory::AnalysisProperties::kRequiresDstTexture);
analysis.fCompatibleWithCoverageAsAlpha &=
@@ -182,8 +180,7 @@
analysis.fHasColorFragmentProcessor = this->hasColorFragmentProcessor();
auto xp = GrXPFactory::MakeXferProcessor(this->xpFactory(), colorAnalysis.outputColor(),
- outputCoverage, hasMixedSampledCoverage, caps,
- clampType);
+ outputCoverage, caps, clampType);
fXP.fProcessor = xp.release();
fFlags |= kFinalized_Flag;
diff --git a/src/gpu/GrProcessorSet.h b/src/gpu/GrProcessorSet.h
index 5b5bc8e..ab1e28b 100644
--- a/src/gpu/GrProcessorSet.h
+++ b/src/gpu/GrProcessorSet.h
@@ -142,10 +142,9 @@
* that owns a processor set is recorded to ensure pending and writes are propagated to
* resources referred to by the processors. Otherwise, data hazards may occur.
*/
- Analysis finalize(
- const GrProcessorAnalysisColor&, const GrProcessorAnalysisCoverage,
- const GrAppliedClip*, const GrUserStencilSettings*, bool hasMixedSampledCoverage,
- const GrCaps&, GrClampType, SkPMColor4f* inputColorOverride);
+ Analysis finalize(const GrProcessorAnalysisColor&, const GrProcessorAnalysisCoverage,
+ const GrAppliedClip*, const GrUserStencilSettings*, const GrCaps&,
+ GrClampType, SkPMColor4f* inputColorOverride);
bool isFinalized() const { return SkToBool(kFinalized_Flag & fFlags); }
diff --git a/src/gpu/GrProgramInfo.h b/src/gpu/GrProgramInfo.h
index 47cdef8..f03e275 100644
--- a/src/gpu/GrProgramInfo.h
+++ b/src/gpu/GrProgramInfo.h
@@ -25,7 +25,7 @@
GrXferBarrierFlags renderPassXferBarriers,
GrLoadOp colorLoadOp)
: fNumSamples(targetView.asRenderTargetProxy()->numSamples())
- , fNumStencilSamples(targetView.asRenderTargetProxy()->numStencilSamples())
+ , fNeedsStencil(targetView.asRenderTargetProxy()->needsStencil())
, fBackendFormat(targetView.proxy()->backendFormat())
, fOrigin(targetView.origin())
, fTargetSupportsVkResolveLoad(
@@ -38,9 +38,8 @@
, fPrimitiveType(primitiveType)
, fTessellationPatchVertexCount(tessellationPatchVertexCount)
, fRenderPassXferBarriers(renderPassXferBarriers)
- , fColorLoadOp(colorLoadOp)
- , fIsMixedSampled(this->isStencilEnabled() && fNumStencilSamples > fNumSamples) {
- SkASSERT(this->numRasterSamples() > 0);
+ , fColorLoadOp(colorLoadOp) {
+ SkASSERT(this->numSamples() > 0);
SkASSERT((GrPrimitiveType::kPatches == fPrimitiveType) ==
(fTessellationPatchVertexCount > 0));
fRequestedFeatures = fGeomProc->requestedFeatures();
@@ -55,16 +54,12 @@
GrProcessor::CustomFeatures requestedFeatures() const { return fRequestedFeatures; }
int numSamples() const { return fNumSamples; }
- int numStencilSamples() const { return fNumStencilSamples; }
+ int needsStencil() const { return fNeedsStencil; }
bool isStencilEnabled() const {
return fUserStencilSettings != &GrUserStencilSettings::kUnused ||
fPipeline->hasStencilClip();
}
const GrUserStencilSettings* userStencilSettings() const { return fUserStencilSettings; }
- int numRasterSamples() const {
- return this->isStencilEnabled() ? fNumStencilSamples : fNumSamples;
- }
- bool isMixedSampled() const { return fIsMixedSampled; }
// The backend format of the destination render target [proxy]
const GrBackendFormat& backendFormat() const { return fBackendFormat; }
GrSurfaceOrigin origin() const { return fOrigin; }
@@ -103,7 +98,7 @@
private:
const int fNumSamples;
- const int fNumStencilSamples;
+ const bool fNeedsStencil;
const GrBackendFormat fBackendFormat;
const GrSurfaceOrigin fOrigin;
const bool fTargetSupportsVkResolveLoad;
@@ -115,7 +110,6 @@
uint8_t fTessellationPatchVertexCount; // GrPrimType::kPatches.
GrXferBarrierFlags fRenderPassXferBarriers;
GrLoadOp fColorLoadOp;
- const bool fIsMixedSampled;
};
#endif
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index 3e109b5..72587a5 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -40,14 +40,6 @@
}
void GrRenderTarget::attachStencilAttachment(sk_sp<GrAttachment> stencil) {
-#ifdef SK_DEBUG
- if (fSampleCnt > 1) {
- // Render targets with >1 color sample should never use mixed samples. (This would lead to
- // different sample patterns, depending on stencil state.)
- SkASSERT(!stencil || stencil->numSamples() == fSampleCnt);
- }
-#endif
-
if (!stencil && !fStencilAttachment) {
// No need to do any work since we currently don't have a stencil attachment and
// we're not actually adding one.
diff --git a/src/gpu/GrRenderTargetProxy.h b/src/gpu/GrRenderTargetProxy.h
index 2c1089e..17bb158 100644
--- a/src/gpu/GrRenderTargetProxy.h
+++ b/src/gpu/GrRenderTargetProxy.h
@@ -54,26 +54,12 @@
// Actually instantiate the backing rendertarget, if necessary.
bool instantiate(GrResourceProvider*) override;
- bool canUseMixedSamples(const GrCaps& caps) const {
- return caps.mixedSamplesSupport() && !this->glRTFBOIDIs0() &&
- caps.internalMultisampleCount(this->backendFormat()) > 1 &&
- this->canChangeStencilAttachment();
- }
-
/*
- * Indicate that a draw to this proxy requires stencil, and how many stencil samples it needs.
- * The number of stencil samples on this proxy will be equal to the largest sample count passed
- * to this method.
+ * Indicate that a draw to this proxy requires stencil.
*/
- void setNeedsStencil(int8_t numStencilSamples) {
- SkASSERT(numStencilSamples >= fSampleCnt);
- fNumStencilSamples = std::max(numStencilSamples, fNumStencilSamples);
- }
+ void setNeedsStencil() { fNeedsStencil = true; }
- /**
- * Returns the number of stencil samples this proxy will use, or 0 if it does not use stencil.
- */
- int numStencilSamples() const { return fNumStencilSamples; }
+ int needsStencil() const { return fNeedsStencil; }
/**
* Returns the number of samples/pixel in the color buffer (One if non-MSAA).
@@ -186,7 +172,7 @@
// that particular class don't require it. Changing the size of this object can move the start
// address of other types, leading to this problem.
int8_t fSampleCnt;
- int8_t fNumStencilSamples = 0;
+ int8_t fNeedsStencil = false;
WrapsVkSecondaryCB fWrapsVkSecondaryCB;
SkIRect fMSAADirtyRect = SkIRect::MakeEmpty();
sk_sp<GrArenas> fArenas{nullptr};
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 4effeca..841d605 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -493,10 +493,11 @@
return buffer;
}
-bool GrResourceProvider::attachStencilAttachment(GrRenderTarget* rt, int numStencilSamples) {
+bool GrResourceProvider::attachStencilAttachment(GrRenderTarget* rt) {
SkASSERT(rt);
GrAttachment* stencil = rt->getStencilAttachment();
- if (stencil && stencil->numSamples() == numStencilSamples) {
+ if (stencil) {
+ SkASSERT(stencil->numSamples() == rt->numSamples());
return true;
}
@@ -517,13 +518,12 @@
GrProtected isProtected = rt->isProtected() ? GrProtected::kYes : GrProtected::kNo;
GrAttachment::ComputeSharedAttachmentUniqueKey(
*this->caps(), stencilFormat, rt->dimensions(),
- GrAttachment::UsageFlags::kStencilAttachment, numStencilSamples, GrMipmapped::kNo,
+ GrAttachment::UsageFlags::kStencilAttachment, rt->numSamples(), GrMipmapped::kNo,
isProtected, &sbKey);
auto stencil = this->findByUniqueKey<GrAttachment>(sbKey);
if (!stencil) {
// Need to try and create a new stencil
- stencil = this->gpu()->makeStencilAttachmentForRenderTarget(rt, rt->dimensions(),
- numStencilSamples);
+ stencil = this->gpu()->makeStencilAttachmentForRenderTarget(rt, rt->dimensions());
if (!stencil) {
return false;
}
@@ -531,11 +531,9 @@
}
rt->attachStencilAttachment(std::move(stencil));
}
-
- if (GrAttachment* stencil = rt->getStencilAttachment()) {
- return stencil->numSamples() == numStencilSamples;
- }
- return false;
+ stencil = rt->getStencilAttachment();
+ SkASSERT(!stencil || stencil->numSamples() == rt->numSamples());
+ return stencil != nullptr;
}
sk_sp<GrAttachment> GrResourceProvider::makeMSAAAttachment(SkISize dimensions,
diff --git a/src/gpu/GrResourceProvider.h b/src/gpu/GrResourceProvider.h
index 26da9c9..a848d21 100644
--- a/src/gpu/GrResourceProvider.h
+++ b/src/gpu/GrResourceProvider.h
@@ -270,7 +270,7 @@
* If passed in render target already has a stencil buffer with at least "numSamples" samples,
* return true. Otherwise attempt to attach one and return true on success.
*/
- bool attachStencilAttachment(GrRenderTarget* rt, int numStencilSamples);
+ bool attachStencilAttachment(GrRenderTarget* rt);
sk_sp<GrAttachment> makeMSAAAttachment(SkISize dimensions,
const GrBackendFormat& format,
diff --git a/src/gpu/GrStencilMaskHelper.cpp b/src/gpu/GrStencilMaskHelper.cpp
index b3e23cc..8f5b9b0 100644
--- a/src/gpu/GrStencilMaskHelper.cpp
+++ b/src/gpu/GrStencilMaskHelper.cpp
@@ -288,8 +288,7 @@
GrPaint paint;
paint.setXPFactory(GrDisableColorXPFactory::Get());
- // Since we are only drawing to the stencil buffer, we can use kMSAA even if the render
- // target is mixed sampled.
+ // kMSAA is the only type of AA that's possible on a stencil buffer.
GrAAType pathAAType = aa == GrAA::kYes ? GrAAType::kMSAA : GrAAType::kNone;
GrPathRenderer::DrawPathArgs args{context,
@@ -322,7 +321,6 @@
}
static GrAA supported_aa(GrSurfaceDrawContext* rtc, GrAA aa) {
- // MIXED SAMPLES TODO: We can use stencil with mixed samples as well.
if (rtc->numSamples() > 1) {
if (rtc->caps()->multisampleDisableSupport()) {
return aa;
diff --git a/src/gpu/GrSurfaceDrawContext.cpp b/src/gpu/GrSurfaceDrawContext.cpp
index 6961aff..6a317dc 100644
--- a/src/gpu/GrSurfaceDrawContext.cpp
+++ b/src/gpu/GrSurfaceDrawContext.cpp
@@ -829,28 +829,16 @@
// Although the clear will ignore the stencil buffer, following draw ops may not so we can't get
// rid of all the preceding ops. Beware! If we ever add any ops that have a side effect beyond
// modifying the stencil buffer we will need a more elaborate tracking system (skbug.com/7002).
- return GrOpsTask::CanDiscardPreviousOps(!fNumStencilSamples);
+ return GrOpsTask::CanDiscardPreviousOps(!fNeedsStencil);
}
-void GrSurfaceDrawContext::setNeedsStencil(bool useMixedSamplesIfNotMSAA) {
- // Don't clear stencil until after we've changed fNumStencilSamples. This ensures we don't loop
- // forever in the event that there are driver bugs and we need to clear as a draw.
- bool hasInitializedStencil = fNumStencilSamples > 0;
-
- int numRequiredSamples = this->numSamples();
- if (useMixedSamplesIfNotMSAA && 1 == numRequiredSamples) {
- SkASSERT(this->asRenderTargetProxy()->canUseMixedSamples(*this->caps()));
- numRequiredSamples =
- this->caps()->internalMultisampleCount(this->asSurfaceProxy()->backendFormat());
- }
- SkASSERT(numRequiredSamples > 0);
-
- if (numRequiredSamples > fNumStencilSamples) {
- fNumStencilSamples = numRequiredSamples;
- this->asRenderTargetProxy()->setNeedsStencil(fNumStencilSamples);
- }
-
+void GrSurfaceDrawContext::setNeedsStencil() {
+ // Don't clear stencil until after we've set fNeedsStencil. This ensures we don't loop forever
+ // in the event that there are driver bugs and we need to clear as a draw.
+ bool hasInitializedStencil = fNeedsStencil;
+ fNeedsStencil = true;
if (!hasInitializedStencil) {
+ this->asRenderTargetProxy()->setNeedsStencil();
if (this->caps()->performStencilClearsAsDraws()) {
// There is a driver bug with clearing stencil. We must use an op to manually clear the
// stencil buffer before the op that required 'setNeedsStencil'.
@@ -863,7 +851,7 @@
}
void GrSurfaceDrawContext::internalStencilClear(const SkIRect* scissor, bool insideStencilMask) {
- this->setNeedsStencil(/* useMixedSamplesIfNotMSAA = */ false);
+ this->setNeedsStencil();
GrScissorState scissorState(this->asSurfaceProxy()->backingStoreDimensions());
if (scissor && !scissorState.set(*scissor)) {
@@ -1897,7 +1885,7 @@
bool usesUserStencilBits = fixedFunctionFlags & GrDrawOp::FixedFunctionFlags::kUsesStencil;
if (usesUserStencilBits) { // Stencil clipping will call setNeedsStencil on its own, if needed.
- this->setNeedsStencil(usesHWAA);
+ this->setNeedsStencil();
}
bool skipDraw = false;
@@ -1920,20 +1908,8 @@
return;
}
- bool willUseStencil = usesUserStencilBits || appliedClip.hasStencilClip();
- SkASSERT(!willUseStencil || fNumStencilSamples > 0);
-
- // If stencil is enabled and the framebuffer is mixed sampled, then the graphics pipeline will
- // have mixed sampled coverage, regardless of whether HWAA is enabled. (e.g., a non-aa draw
- // that uses a stencil test when the stencil buffer is multisampled.)
- bool hasMixedSampledCoverage = (
- willUseStencil && fNumStencilSamples > this->numSamples());
- SkASSERT(!hasMixedSampledCoverage ||
- this->asRenderTargetProxy()->canUseMixedSamples(*this->caps()));
-
GrClampType clampType = GrColorTypeClampType(this->colorInfo().colorType());
- GrProcessorSet::Analysis analysis = drawOp->finalize(
- *this->caps(), &appliedClip, hasMixedSampledCoverage, clampType);
+ GrProcessorSet::Analysis analysis = drawOp->finalize(*this->caps(), &appliedClip, clampType);
// Must be called before setDstProxyView so that it sees the final bounds of the op.
op->setClippedBounds(bounds);
diff --git a/src/gpu/GrSurfaceDrawContext.h b/src/gpu/GrSurfaceDrawContext.h
index 6e0ecaa..1bd93de 100644
--- a/src/gpu/GrSurfaceDrawContext.h
+++ b/src/gpu/GrSurfaceDrawContext.h
@@ -663,7 +663,7 @@
GrAAType chooseAAType(GrAA);
GrOpsTask::CanDiscardPreviousOps canDiscardPreviousOpsOnFullClear() const override;
- void setNeedsStencil(bool useMixedSamplesIfNotMSAA);
+ void setNeedsStencil();
void internalStencilClear(const SkIRect* scissor, bool insideStencilMask);
@@ -729,7 +729,7 @@
SkSurfaceProps fSurfaceProps;
- int fNumStencilSamples = 0;
+ bool fNeedsStencil = false;
GrDstSampleType fDstSampleType = GrDstSampleType::kNone;
diff --git a/src/gpu/GrSurfaceFillContext.cpp b/src/gpu/GrSurfaceFillContext.cpp
index 8d1a8de..a37d129 100644
--- a/src/gpu/GrSurfaceFillContext.cpp
+++ b/src/gpu/GrSurfaceFillContext.cpp
@@ -291,10 +291,7 @@
GrClampType clampType = GrColorTypeClampType(this->colorInfo().colorType());
auto clip = GrAppliedClip::Disabled();
const GrCaps& caps = *this->caps();
- GrProcessorSet::Analysis analysis = op->finalize(caps,
- &clip,
- /*mixed sample coverage*/ false,
- clampType);
+ GrProcessorSet::Analysis analysis = op->finalize(caps, &clip, clampType);
SkASSERT(!(op->fixedFunctionFlags() & GrDrawOp::FixedFunctionFlags::kUsesStencil));
SkASSERT(!analysis.requiresDstTexture());
SkRect bounds = owner->bounds();
diff --git a/src/gpu/GrXferProcessor.cpp b/src/gpu/GrXferProcessor.cpp
index e65f4fa..2921ae0 100644
--- a/src/gpu/GrXferProcessor.cpp
+++ b/src/gpu/GrXferProcessor.cpp
@@ -13,21 +13,19 @@
GrXferProcessor::GrXferProcessor(ClassID classID)
: INHERITED(classID)
, fWillReadDstColor(false)
- , fDstReadUsesMixedSamples(false)
, fIsLCD(false) {}
-GrXferProcessor::GrXferProcessor(ClassID classID, bool willReadDstColor, bool hasMixedSamples,
+GrXferProcessor::GrXferProcessor(ClassID classID, bool willReadDstColor,
GrProcessorAnalysisCoverage coverage)
: INHERITED(classID)
, fWillReadDstColor(willReadDstColor)
- , fDstReadUsesMixedSamples(willReadDstColor && hasMixedSamples)
, fIsLCD(GrProcessorAnalysisCoverage::kLCD == coverage) {}
bool GrXferProcessor::hasSecondaryOutput() const {
if (!this->willReadDstColor()) {
return this->onHasSecondaryOutput();
}
- return this->dstReadUsesMixedSamples();
+ return false;
}
void GrXferProcessor::getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b,
@@ -46,12 +44,9 @@
key |= 0x8;
}
}
- if (this->dstReadUsesMixedSamples()) {
- key |= 0x10;
- }
}
if (fIsLCD) {
- key |= 0x20;
+ key |= 0x10;
}
b->add32(key);
this->onGetGLSLProcessorKey(caps, b);
@@ -159,15 +154,13 @@
const GrXPFactory* factory,
const GrProcessorAnalysisColor& color,
const GrProcessorAnalysisCoverage& coverage,
- bool hasMixedSamples,
const GrCaps& caps,
GrClampType clampType) {
AnalysisProperties result;
if (factory) {
- result = factory->analysisProperties(color, coverage, hasMixedSamples, caps, clampType);
+ result = factory->analysisProperties(color, coverage, caps, clampType);
} else {
- result = GrPorterDuffXPFactory::SrcOverAnalysisProperties(color, coverage, hasMixedSamples,
- caps, clampType);
+ result = GrPorterDuffXPFactory::SrcOverAnalysisProperties(color, coverage, caps, clampType);
}
if (coverage == GrProcessorAnalysisCoverage::kNone) {
result |= AnalysisProperties::kCompatibleWithCoverageAsAlpha;
@@ -184,15 +177,11 @@
sk_sp<const GrXferProcessor> GrXPFactory::MakeXferProcessor(const GrXPFactory* factory,
const GrProcessorAnalysisColor& color,
GrProcessorAnalysisCoverage coverage,
- bool hasMixedSamples,
const GrCaps& caps,
GrClampType clampType) {
- SkASSERT(!hasMixedSamples || caps.shaderCaps()->dualSourceBlendingSupport());
-
if (factory) {
- return factory->makeXferProcessor(color, coverage, hasMixedSamples, caps, clampType);
+ return factory->makeXferProcessor(color, coverage, caps, clampType);
} else {
- return GrPorterDuffXPFactory::MakeSrcOverXferProcessor(color, coverage, hasMixedSamples,
- caps);
+ return GrPorterDuffXPFactory::MakeSrcOverXferProcessor(color, coverage, caps);
}
}
diff --git a/src/gpu/GrXferProcessor.h b/src/gpu/GrXferProcessor.h
index c968e89..3991cb2 100644
--- a/src/gpu/GrXferProcessor.h
+++ b/src/gpu/GrXferProcessor.h
@@ -147,8 +147,6 @@
BlendInfo blendInfo;
if (!this->willReadDstColor()) {
this->onGetBlendInfo(&blendInfo);
- } else if (this->dstReadUsesMixedSamples()) {
- blendInfo.fDstBlend = kIS2A_GrBlendCoeff;
}
return blendInfo;
}
@@ -156,13 +154,6 @@
bool willReadDstColor() const { return fWillReadDstColor; }
/**
- * If we are performing a dst read, returns whether the base class will use mixed samples to
- * antialias the shader's final output. If not doing a dst read, the subclass is responsible
- * for antialiasing and this returns false.
- */
- bool dstReadUsesMixedSamples() const { return fDstReadUsesMixedSamples; }
-
- /**
* Returns whether or not this xferProcossor will set a secondary output to be used with dual
* source blending.
*/
@@ -185,9 +176,6 @@
if (this->fWillReadDstColor != that.fWillReadDstColor) {
return false;
}
- if (this->fDstReadUsesMixedSamples != that.fDstReadUsesMixedSamples) {
- return false;
- }
if (fIsLCD != that.fIsLCD) {
return false;
}
@@ -196,8 +184,7 @@
protected:
GrXferProcessor(ClassID classID);
- GrXferProcessor(ClassID classID, bool willReadDstColor, bool hasMixedSamples,
- GrProcessorAnalysisCoverage);
+ GrXferProcessor(ClassID classID, bool willReadDstColor, GrProcessorAnalysisCoverage);
private:
/**
@@ -223,7 +210,6 @@
virtual bool onIsEqual(const GrXferProcessor&) const = 0;
bool fWillReadDstColor;
- bool fDstReadUsesMixedSamples;
bool fIsLCD;
using INHERITED = GrProcessor;
@@ -300,14 +286,12 @@
static sk_sp<const GrXferProcessor> MakeXferProcessor(const GrXPFactory*,
const GrProcessorAnalysisColor&,
GrProcessorAnalysisCoverage,
- bool hasMixedSamples,
const GrCaps& caps,
GrClampType);
static AnalysisProperties GetAnalysisProperties(const GrXPFactory*,
const GrProcessorAnalysisColor&,
const GrProcessorAnalysisCoverage&,
- bool hasMixedSamples,
const GrCaps&,
GrClampType);
@@ -317,7 +301,6 @@
private:
virtual sk_sp<const GrXferProcessor> makeXferProcessor(const GrProcessorAnalysisColor&,
GrProcessorAnalysisCoverage,
- bool hasMixedSamples,
const GrCaps&,
GrClampType) const = 0;
@@ -327,7 +310,6 @@
*/
virtual AnalysisProperties analysisProperties(const GrProcessorAnalysisColor&,
const GrProcessorAnalysisCoverage&,
- bool hasMixedSamples,
const GrCaps&,
GrClampType) const = 0;
};
diff --git a/src/gpu/ccpr/GrCCPerFlushResources.cpp b/src/gpu/ccpr/GrCCPerFlushResources.cpp
index bd98137..5471fba 100644
--- a/src/gpu/ccpr/GrCCPerFlushResources.cpp
+++ b/src/gpu/ccpr/GrCCPerFlushResources.cpp
@@ -95,19 +95,6 @@
// This will be the final op in the surfaceDrawContext. So if Ganesh is planning to discard the
// stencil values anyway, then we might not actually need to reset the stencil values back to 0.
bool mustResetStencil = !onFlushRP->caps()->discardStencilValuesAfterRenderPass();
-
- if (surfaceDrawContext->numSamples() == 1) {
- // We are mixed sampled. We need to either enable conservative raster (preferred) or disable
- // MSAA in order to avoid double blend artifacts. (Even if we disable MSAA for the cover
- // geometry, the stencil test is still multisampled and will still produce smooth results.)
- if (onFlushRP->caps()->conservativeRasterSupport()) {
- fillRectFlags |= GrSimpleMeshDrawOpHelper::InputFlags::kConservativeRaster;
- } else {
- aaType = GrAAType::kNone;
- }
- mustResetStencil = true;
- }
-
const GrUserStencilSettings* stencil;
if (mustResetStencil) {
constexpr static GrUserStencilSettings kTestAndResetStencil(
diff --git a/src/gpu/d3d/GrD3DCaps.cpp b/src/gpu/d3d/GrD3DCaps.cpp
index b6f82ff..a877e71 100644
--- a/src/gpu/d3d/GrD3DCaps.cpp
+++ b/src/gpu/d3d/GrD3DCaps.cpp
@@ -183,9 +183,6 @@
fMultisampleDisableSupport = true;
}
- // TODO: It's not clear if this is supported or not.
- fMixedSamplesSupport = false;
-
if (D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED !=
optionsDesc.ConservativeRasterizationTier) {
fConservativeRasterSupport = true;
@@ -1057,13 +1054,10 @@
programInfo.pipeline().genKey(&b, *this);
// The num samples is already added in the render target key so we don't need to add it here.
- SkASSERT(programInfo.numRasterSamples() == rt->numSamples());
// D3D requires the full primitive type as part of its key
b.add32(programInfo.primitiveTypeKey());
- SkASSERT(!this->mixedSamplesSupport());
-
b.flush();
return desc;
}
diff --git a/src/gpu/d3d/GrD3DGpu.cpp b/src/gpu/d3d/GrD3DGpu.cpp
index ce6c819..0014f0f 100644
--- a/src/gpu/d3d/GrD3DGpu.cpp
+++ b/src/gpu/d3d/GrD3DGpu.cpp
@@ -882,16 +882,14 @@
}
sk_sp<GrAttachment> GrD3DGpu::makeStencilAttachmentForRenderTarget(const GrRenderTarget* rt,
- SkISize dimensions,
- int numStencilSamples) {
- SkASSERT(numStencilSamples == rt->numSamples() || this->caps()->mixedSamplesSupport());
+ SkISize dimensions) {
SkASSERT(dimensions.width() >= rt->width());
SkASSERT(dimensions.height() >= rt->height());
DXGI_FORMAT sFmt = this->d3dCaps().preferredStencilFormat();
fStats.incStencilAttachmentCreates();
- return GrD3DAttachment::MakeStencil(this, dimensions, numStencilSamples, sFmt);
+ return GrD3DAttachment::MakeStencil(this, dimensions, rt->numSamples(), sFmt);
}
bool GrD3DGpu::createTextureResourceForBackendSurface(DXGI_FORMAT dxgiFormat,
diff --git a/src/gpu/d3d/GrD3DGpu.h b/src/gpu/d3d/GrD3DGpu.h
index 7b6db87..8d14e26 100644
--- a/src/gpu/d3d/GrD3DGpu.h
+++ b/src/gpu/d3d/GrD3DGpu.h
@@ -77,8 +77,7 @@
#endif
sk_sp<GrAttachment> makeStencilAttachmentForRenderTarget(const GrRenderTarget*,
- SkISize dimensions,
- int numStencilSamples) override;
+ SkISize dimensions) override;
GrBackendFormat getPreferredStencilFormat(const GrBackendFormat&) override {
return GrBackendFormat::MakeDxgi(this->d3dCaps().preferredStencilFormat());
diff --git a/src/gpu/d3d/GrD3DPipelineStateBuilder.cpp b/src/gpu/d3d/GrD3DPipelineStateBuilder.cpp
index 81f0aae..3eaf828 100644
--- a/src/gpu/d3d/GrD3DPipelineStateBuilder.cpp
+++ b/src/gpu/d3d/GrD3DPipelineStateBuilder.cpp
@@ -543,8 +543,8 @@
psoDesc.DSVFormat = depthStencilFormat;
- unsigned int numRasterSamples = programInfo.numRasterSamples();
- psoDesc.SampleDesc = { numRasterSamples, sampleQualityPattern };
+ unsigned int numSamples = programInfo.numSamples();
+ psoDesc.SampleDesc = { numSamples, sampleQualityPattern };
// Only used for multi-adapter systems.
psoDesc.NodeMask = 0;
diff --git a/src/gpu/dawn/GrDawnGpu.cpp b/src/gpu/dawn/GrDawnGpu.cpp
index 5298098..ba92c34 100644
--- a/src/gpu/dawn/GrDawnGpu.cpp
+++ b/src/gpu/dawn/GrDawnGpu.cpp
@@ -294,10 +294,9 @@
}
sk_sp<GrAttachment> GrDawnGpu::makeStencilAttachmentForRenderTarget(const GrRenderTarget* rt,
- SkISize dimensions,
- int numStencilSamples) {
+ SkISize dimensions) {
fStats.incStencilAttachmentCreates();
- return GrDawnAttachment::MakeStencil(this, dimensions, numStencilSamples);
+ return GrDawnAttachment::MakeStencil(this, dimensions, rt->numSamples());
}
GrBackendTexture GrDawnGpu::onCreateBackendTexture(SkISize dimensions,
diff --git a/src/gpu/dawn/GrDawnGpu.h b/src/gpu/dawn/GrDawnGpu.h
index f1b34b4..cd61517 100644
--- a/src/gpu/dawn/GrDawnGpu.h
+++ b/src/gpu/dawn/GrDawnGpu.h
@@ -60,8 +60,7 @@
#endif
sk_sp<GrAttachment> makeStencilAttachmentForRenderTarget(const GrRenderTarget*,
- SkISize dimensions,
- int numStencilSamples) override;
+ SkISize dimensions) override;
GrBackendFormat getPreferredStencilFormat(const GrBackendFormat&) override {
return GrBackendFormat::MakeDawn(wgpu::TextureFormat::Depth24PlusStencil8);
diff --git a/src/gpu/effects/GrCoverageSetOpXP.cpp b/src/gpu/effects/GrCoverageSetOpXP.cpp
index 4d91546..16603c0 100644
--- a/src/gpu/effects/GrCoverageSetOpXP.cpp
+++ b/src/gpu/effects/GrCoverageSetOpXP.cpp
@@ -199,17 +199,8 @@
sk_sp<const GrXferProcessor> GrCoverageSetOpXPFactory::makeXferProcessor(
const GrProcessorAnalysisColor&,
GrProcessorAnalysisCoverage,
- bool hasMixedSamples,
const GrCaps& caps,
GrClampType) const {
- // We don't support inverting coverage with mixed samples. We don't expect to ever want this in
- // the future, however we could at some point make this work using an inverted coverage
- // modulation table. Note that an inverted table still won't work if there are coverage procs.
- if (fInvertCoverage && hasMixedSamples) {
- SkASSERT(false);
- return nullptr;
- }
-
return sk_sp<GrXferProcessor>(new CoverageSetOpXP(fRegionOp, fInvertCoverage));
}
diff --git a/src/gpu/effects/GrCoverageSetOpXP.h b/src/gpu/effects/GrCoverageSetOpXP.h
index daab0af..1d54a10 100644
--- a/src/gpu/effects/GrCoverageSetOpXP.h
+++ b/src/gpu/effects/GrCoverageSetOpXP.h
@@ -36,13 +36,11 @@
sk_sp<const GrXferProcessor> makeXferProcessor(const GrProcessorAnalysisColor&,
GrProcessorAnalysisCoverage,
- bool hasMixedSamples,
const GrCaps&,
GrClampType) const override;
AnalysisProperties analysisProperties(const GrProcessorAnalysisColor& color,
const GrProcessorAnalysisCoverage& coverage,
- bool hasMixedSamples,
const GrCaps&,
GrClampType) const override {
auto props = AnalysisProperties::kIgnoresInputColor;
@@ -53,8 +51,7 @@
case SkRegion::kUnion_Op:
case SkRegion::kDifference_Op:
// FIXME: If we can formalize the fact that this op only operates on alpha, we can
- // set AnalysisProperties::kUnaffectedByDstValue if color/coverage/hasMixedSamples
- // are all opaque.
+ // set AnalysisProperties::kUnaffectedByDstValue if color/coverage are all opaque.
break;
case SkRegion::kIntersect_Op:
case SkRegion::kXOR_Op:
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index c331860..951b994 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -78,8 +78,8 @@
, fMode(mode)
, fHWBlendEquation(hwBlendEquation) {}
- CustomXP(bool hasMixedSamples, SkBlendMode mode, GrProcessorAnalysisCoverage coverage)
- : INHERITED(kCustomXP_ClassID, true, hasMixedSamples, coverage)
+ CustomXP(SkBlendMode mode, GrProcessorAnalysisCoverage coverage)
+ : INHERITED(kCustomXP_ClassID, true, coverage)
, fMode(mode)
, fHWBlendEquation(kIllegal_GrBlendEquation) {
}
@@ -141,8 +141,8 @@
GrGLSLXPFragmentBuilder* fragBuilder = args.fXPFragBuilder;
fragBuilder->enableAdvancedBlendEquationIfNeeded(xp.hwBlendEquation());
- // Apply coverage by multiplying it into the src color before blending. Mixed samples will
- // "just work" automatically. (See onGetOptimizations())
+ // Apply coverage by multiplying it into the src color before blending. This will "just
+ // work" automatically. (See analysisProperties())
fragBuilder->codeAppendf("%s = %s * %s;", args.fOutputPrimary, args.fInputCoverage,
args.fInputColor);
}
@@ -218,13 +218,11 @@
private:
sk_sp<const GrXferProcessor> makeXferProcessor(const GrProcessorAnalysisColor&,
GrProcessorAnalysisCoverage,
- bool hasMixedSamples,
const GrCaps&,
GrClampType) const override;
AnalysisProperties analysisProperties(const GrProcessorAnalysisColor&,
const GrProcessorAnalysisCoverage&,
- bool hasMixedSamples,
const GrCaps&,
GrClampType) const override;
@@ -245,19 +243,18 @@
sk_sp<const GrXferProcessor> CustomXPFactory::makeXferProcessor(
const GrProcessorAnalysisColor&,
GrProcessorAnalysisCoverage coverage,
- bool hasMixedSamples,
const GrCaps& caps,
GrClampType clampType) const {
SkASSERT(GrCustomXfermode::IsSupportedMode(fMode));
if (can_use_hw_blend_equation(fHWBlendEquation, coverage, caps)) {
return sk_sp<GrXferProcessor>(new CustomXP(fMode, fHWBlendEquation));
}
- return sk_sp<GrXferProcessor>(new CustomXP(hasMixedSamples, fMode, coverage));
+ return sk_sp<GrXferProcessor>(new CustomXP(fMode, coverage));
}
GrXPFactory::AnalysisProperties CustomXPFactory::analysisProperties(
const GrProcessorAnalysisColor&, const GrProcessorAnalysisCoverage& coverage,
- bool hasMixedSamples, const GrCaps& caps, GrClampType clampType) const {
+ const GrCaps& caps, GrClampType clampType) const {
/*
The general SVG blend equation is defined in the spec as follows:
diff --git a/src/gpu/effects/GrDisableColorXP.h b/src/gpu/effects/GrDisableColorXP.h
index cc852fc..7ffd71b 100644
--- a/src/gpu/effects/GrDisableColorXP.h
+++ b/src/gpu/effects/GrDisableColorXP.h
@@ -31,15 +31,15 @@
constexpr GrDisableColorXPFactory() {}
AnalysisProperties analysisProperties(
- const GrProcessorAnalysisColor&, const GrProcessorAnalysisCoverage&,
- bool hasMixedSamples, const GrCaps&, GrClampType) const override {
+ const GrProcessorAnalysisColor&, const GrProcessorAnalysisCoverage&, const GrCaps&,
+ GrClampType) const override {
return AnalysisProperties::kCompatibleWithCoverageAsAlpha |
AnalysisProperties::kIgnoresInputColor;
}
sk_sp<const GrXferProcessor> makeXferProcessor(
- const GrProcessorAnalysisColor&, GrProcessorAnalysisCoverage, bool hasMixedSamples,
- const GrCaps&, GrClampType) const override {
+ const GrProcessorAnalysisColor&, GrProcessorAnalysisCoverage, const GrCaps&,
+ GrClampType) const override {
return MakeXferProcessor();
}
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
index eee3104..1e0591f 100644
--- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
@@ -27,8 +27,8 @@
class BlendFormula {
public:
/**
- * Values the shader can write to primary and secondary outputs. These must all be modulated by
- * coverage to support mixed samples. The XP will ignore the multiplies when not using coverage.
+ * Values the shader can write to primary and secondary outputs. These are all modulated by
+ * coverage. The XP will ignore the multiplies when not using coverage.
*/
enum OutputType {
kNone_OutputType, //<! 0
@@ -358,11 +358,9 @@
static BlendFormula get_blend_formula(bool isOpaque,
bool hasCoverage,
- bool hasMixedSamples,
SkBlendMode xfermode) {
SkASSERT((unsigned)xfermode <= (unsigned)SkBlendMode::kLastCoeffMode);
- bool conflatesCoverage = hasCoverage || hasMixedSamples;
- return gBlendTable[isOpaque][conflatesCoverage][(int)xfermode];
+ return gBlendTable[isOpaque][hasCoverage][(int)xfermode];
}
static BlendFormula get_lcd_blend_formula(SkBlendMode xfermode) {
@@ -376,7 +374,7 @@
class PorterDuffXferProcessor : public GrXferProcessor {
public:
PorterDuffXferProcessor(BlendFormula blendFormula, GrProcessorAnalysisCoverage coverage)
- : INHERITED(kPorterDuffXferProcessor_ClassID, false, false, coverage)
+ : INHERITED(kPorterDuffXferProcessor_ClassID, false, coverage)
, fBlendFormula(blendFormula) {
}
@@ -421,7 +419,6 @@
fragBuilder->codeAppendf("%s = half4(0.0);", output);
break;
case BlendFormula::kCoverage_OutputType:
- // We can have a coverage formula while not reading coverage if there are mixed samples.
fragBuilder->codeAppendf("%s = %s;", output, inCoverage);
break;
case BlendFormula::kModulate_OutputType:
@@ -485,9 +482,8 @@
class ShaderPDXferProcessor : public GrXferProcessor {
public:
- ShaderPDXferProcessor(bool hasMixedSamples, SkBlendMode xfermode,
- GrProcessorAnalysisCoverage coverage)
- : INHERITED(kShaderPDXferProcessor_ClassID, true, hasMixedSamples, coverage)
+ ShaderPDXferProcessor(SkBlendMode xfermode, GrProcessorAnalysisCoverage coverage)
+ : INHERITED(kShaderPDXferProcessor_ClassID, true, coverage)
, fXfermode(xfermode) {
}
@@ -634,7 +630,7 @@
///////////////////////////////////////////////////////////////////////////////
PDLCDXferProcessor::PDLCDXferProcessor(const SkPMColor4f& blendConstant, float alpha)
- : INHERITED(kPDLCDXferProcessor_ClassID, false, false, GrProcessorAnalysisCoverage::kLCD)
+ : INHERITED(kPDLCDXferProcessor_ClassID, false, GrProcessorAnalysisCoverage::kLCD)
, fBlendConstant(blendConstant)
, fAlpha(alpha) {
}
@@ -728,7 +724,7 @@
sk_sp<const GrXferProcessor> GrPorterDuffXPFactory::makeXferProcessor(
const GrProcessorAnalysisColor& color, GrProcessorAnalysisCoverage coverage,
- bool hasMixedSamples, const GrCaps& caps, GrClampType clampType) const {
+ const GrCaps& caps, GrClampType clampType) const {
bool isLCD = coverage == GrProcessorAnalysisCoverage::kLCD;
// See comment in MakeSrcOverXferProcessor about color.isOpaque here
if (isLCD &&
@@ -744,13 +740,13 @@
return get_lcd_blend_formula(fBlendMode);
}
if (fBlendMode == SkBlendMode::kSrcOver && color.isOpaque() &&
- coverage == GrProcessorAnalysisCoverage::kNone && !hasMixedSamples &&
+ coverage == GrProcessorAnalysisCoverage::kNone &&
caps.shouldCollapseSrcOverToSrcWhenAble())
{
- return get_blend_formula(true, false, false, SkBlendMode::kSrc);
+ return get_blend_formula(true, false, SkBlendMode::kSrc);
}
return get_blend_formula(color.isOpaque(), GrProcessorAnalysisCoverage::kNone != coverage,
- hasMixedSamples, fBlendMode);
+ fBlendMode);
}();
// Skia always saturates after the kPlus blend mode, so it requires shader-based blending when
@@ -758,15 +754,14 @@
if ((blendFormula.hasSecondaryOutput() && !caps.shaderCaps()->dualSourceBlendingSupport()) ||
(isLCD && (SkBlendMode::kSrcOver != fBlendMode /*|| !color.isOpaque()*/)) ||
(GrClampType::kAuto != clampType && SkBlendMode::kPlus == fBlendMode)) {
- return sk_sp<const GrXferProcessor>(new ShaderPDXferProcessor(hasMixedSamples, fBlendMode,
- coverage));
+ return sk_sp<const GrXferProcessor>(new ShaderPDXferProcessor(fBlendMode, coverage));
}
return sk_sp<const GrXferProcessor>(new PorterDuffXferProcessor(blendFormula, coverage));
}
static inline GrXPFactory::AnalysisProperties analysis_properties(
const GrProcessorAnalysisColor& color, const GrProcessorAnalysisCoverage& coverage,
- bool hasMixedSamples, const GrCaps& caps, GrClampType clampType, SkBlendMode mode) {
+ const GrCaps& caps, GrClampType clampType, SkBlendMode mode) {
using AnalysisProperties = GrXPFactory::AnalysisProperties;
AnalysisProperties props = AnalysisProperties::kNone;
bool hasCoverage = GrProcessorAnalysisCoverage::kNone != coverage;
@@ -775,7 +770,7 @@
if (isLCD) {
return gLCDBlendTable[(int)mode];
}
- return get_blend_formula(color.isOpaque(), hasCoverage, hasMixedSamples, mode);
+ return get_blend_formula(color.isOpaque(), hasCoverage, mode);
}();
if (formula.canTweakAlphaForCoverage() && !isLCD) {
@@ -803,10 +798,6 @@
} else {
// With dual-source blending we never need the destination color in the shader.
if (!caps.shaderCaps()->dualSourceBlendingSupport()) {
- // Mixed samples implicity computes a fractional coverage from sample coverage. This
- // could affect the formula used. However, we don't expect to have mixed samples without
- // dual source blending.
- SkASSERT(!caps.mixedSamplesSupport());
if (formula.hasSecondaryOutput()) {
props |= AnalysisProperties::kReadsDstInShader;
}
@@ -821,7 +812,7 @@
props |= AnalysisProperties::kIgnoresInputColor;
}
if (formula.unaffectedByDst() || (formula.unaffectedByDstIfOpaque() && color.isOpaque() &&
- !hasCoverage && !hasMixedSamples)) {
+ !hasCoverage)) {
props |= AnalysisProperties::kUnaffectedByDstValue;
}
return props;
@@ -830,10 +821,9 @@
GrXPFactory::AnalysisProperties GrPorterDuffXPFactory::analysisProperties(
const GrProcessorAnalysisColor& color,
const GrProcessorAnalysisCoverage& coverage,
- bool hasMixedSamples,
const GrCaps& caps,
GrClampType clampType) const {
- return analysis_properties(color, coverage, hasMixedSamples, caps, clampType, fBlendMode);
+ return analysis_properties(color, coverage, caps, clampType, fBlendMode);
}
GR_DEFINE_XP_FACTORY_TEST(GrPorterDuffXPFactory);
@@ -870,15 +860,15 @@
sk_sp<const GrXferProcessor> GrPorterDuffXPFactory::MakeSrcOverXferProcessor(
const GrProcessorAnalysisColor& color, GrProcessorAnalysisCoverage coverage,
- bool hasMixedSamples, const GrCaps& caps) {
+ const GrCaps& caps) {
// We want to not make an xfer processor if possible. Thus for the simple case where we are not
// doing lcd blending we will just use our global SimpleSrcOverXP. This slightly differs from
// the general case where we convert a src-over blend that has solid coverage and an opaque
// color to src-mode, which allows disabling of blending.
if (coverage != GrProcessorAnalysisCoverage::kLCD) {
if (color.isOpaque() && coverage == GrProcessorAnalysisCoverage::kNone &&
- !hasMixedSamples && caps.shouldCollapseSrcOverToSrcWhenAble()) {
- BlendFormula blendFormula = get_blend_formula(true, false, false, SkBlendMode::kSrc);
+ caps.shouldCollapseSrcOverToSrcWhenAble()) {
+ BlendFormula blendFormula = get_blend_formula(true, false, SkBlendMode::kSrc);
return sk_sp<GrXferProcessor>(new PorterDuffXferProcessor(blendFormula, coverage));
}
// We return nullptr here, which our caller interprets as meaning "use SimpleSrcOverXP".
@@ -910,23 +900,20 @@
// See comment above regarding why the opaque check is commented out here.
if (/*!color.isOpaque() ||*/
(blendFormula.hasSecondaryOutput() && !caps.shaderCaps()->dualSourceBlendingSupport())) {
- return sk_sp<GrXferProcessor>(
- new ShaderPDXferProcessor(hasMixedSamples, SkBlendMode::kSrcOver, coverage));
+ return sk_sp<GrXferProcessor>(new ShaderPDXferProcessor(SkBlendMode::kSrcOver, coverage));
}
return sk_sp<GrXferProcessor>(new PorterDuffXferProcessor(blendFormula, coverage));
}
sk_sp<const GrXferProcessor> GrPorterDuffXPFactory::MakeNoCoverageXP(SkBlendMode blendmode) {
- BlendFormula formula = get_blend_formula(false, false, false, blendmode);
+ BlendFormula formula = get_blend_formula(false, false, blendmode);
return sk_make_sp<PorterDuffXferProcessor>(formula, GrProcessorAnalysisCoverage::kNone);
}
GrXPFactory::AnalysisProperties GrPorterDuffXPFactory::SrcOverAnalysisProperties(
const GrProcessorAnalysisColor& color,
const GrProcessorAnalysisCoverage& coverage,
- bool hasMixedSamples,
const GrCaps& caps,
GrClampType clampType) {
- return analysis_properties(color, coverage, hasMixedSamples, caps, clampType,
- SkBlendMode::kSrcOver);
+ return analysis_properties(color, coverage, caps, clampType, SkBlendMode::kSrcOver);
}
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.h b/src/gpu/effects/GrPorterDuffXferProcessor.h
index faa8914..76f349f 100644
--- a/src/gpu/effects/GrPorterDuffXferProcessor.h
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.h
@@ -29,7 +29,6 @@
null then the SimpleSrcOverXP() below should be used. */
static sk_sp<const GrXferProcessor> MakeSrcOverXferProcessor(const GrProcessorAnalysisColor&,
GrProcessorAnalysisCoverage,
- bool hasMixedSamples,
const GrCaps&);
/** Returns a simple non-LCD porter duff blend XP with no optimizations or coverage. */
@@ -41,7 +40,6 @@
static AnalysisProperties SrcOverAnalysisProperties(const GrProcessorAnalysisColor&,
const GrProcessorAnalysisCoverage&,
- bool hasMixedSamples,
const GrCaps&,
GrClampType);
@@ -50,13 +48,11 @@
sk_sp<const GrXferProcessor> makeXferProcessor(const GrProcessorAnalysisColor&,
GrProcessorAnalysisCoverage,
- bool hasMixedSamples,
const GrCaps&,
GrClampType) const override;
AnalysisProperties analysisProperties(const GrProcessorAnalysisColor&,
const GrProcessorAnalysisCoverage&,
- bool hasMixedSamples,
const GrCaps&,
GrClampType) const override;
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index fcdf554..be5685a 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -988,11 +988,6 @@
void GrGLCaps::initFSAASupport(const GrContextOptions& contextOptions,
const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
- if (ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples") ||
- ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_mixed_samples")) {
- // fMixedSamplesSupport = true;
- }
-
if (GR_IS_GR_GL(ctxInfo.standard())) {
if (ctxInfo.version() >= GR_GL_VER(3,0) ||
ctxInfo.hasExtension("GL_ARB_framebuffer_object")) {
@@ -2358,8 +2353,6 @@
// non-ES GL we don't support MSAA for GL_RGB8. On 4.2+ we could check using
// glGetInternalFormativ(GL_RENDERBUFFER, GL_RGB8, GL_INTERNALFORMAT_SUPPORTED, ...) if
// this becomes an issue.
- // This also would probably work in mixed-samples mode where there is no MSAA color
- // buffer but we don't support that just for simplicity's sake.
info.fFlags |= nonMSAARenderFlags;
} else if (GR_IS_GR_GL_ES(standard)) {
// 3.0 and the extension support this as a render buffer format.
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index af5a46f..a5249bf 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -546,13 +546,6 @@
if (resetBits & kMSAAEnable_GrGLBackendState) {
fMSAAEnabled = kUnknown_TriState;
-
- if (this->caps()->mixedSamplesSupport()) {
- // The skia blend modes all use premultiplied alpha and therefore expect RGBA coverage
- // modulation. This state has no effect when not rendering to a mixed sampled target.
- GL_CALL(CoverageModulation(GR_GL_RGBA));
- }
-
fHWConservativeRasterEnabled = kUnknown_TriState;
}
@@ -1694,8 +1687,7 @@
}
sk_sp<GrAttachment> GrGLGpu::makeStencilAttachmentForRenderTarget(const GrRenderTarget* rt,
- SkISize dimensions,
- int numStencilSamples) {
+ SkISize dimensions) {
SkASSERT(dimensions.width() >= rt->width());
SkASSERT(dimensions.height() >= rt->height());
@@ -1717,8 +1709,8 @@
GrGLenum glFmt = GrGLFormatToEnum(sFmt);
// we do this "if" so that we don't call the multisample
// version on a GL that doesn't have an MSAA extension.
- if (numStencilSamples > 1) {
- if (!this->renderbufferStorageMSAA(*fGLContext, numStencilSamples, glFmt,
+ if (rt->numSamples() > 1) {
+ if (!this->renderbufferStorageMSAA(*fGLContext, rt->numSamples(), glFmt,
dimensions.width(), dimensions.height())) {
GL_CALL(DeleteRenderbuffers(1, &sbDesc.fRenderbufferID));
return nullptr;
@@ -1736,7 +1728,7 @@
return sk_sp<GrAttachment>(new GrGLAttachment(
this, sbDesc, dimensions, GrAttachment::UsageFlags::kStencilAttachment,
- numStencilSamples, sFmt));
+ rt->numSamples(), sFmt));
}
////////////////////////////////////////////////////////////////////////////////
@@ -2424,15 +2416,7 @@
void GrGLGpu::flushHWAAState(GrRenderTarget* rt, bool useHWAA) {
// rt is only optional if useHWAA is false.
SkASSERT(rt || !useHWAA);
-#ifdef SK_DEBUG
- if (useHWAA && rt->numSamples() <= 1) {
- SkASSERT(this->caps()->mixedSamplesSupport());
- auto glRT = static_cast<GrGLRenderTarget*>(rt);
- SkASSERT(glRT->singleSampleFBOID() != 0);
- SkASSERT(glRT->multisampleFBOID() == 0);
- SkASSERT(rt->getStencilAttachment());
- }
-#endif
+ SkASSERT(!useHWAA || rt->numSamples() > 1);
if (this->caps()->multisampleDisableSupport()) {
if (useHWAA) {
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index b2c3fbf..ad87530 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -129,8 +129,7 @@
}
sk_sp<GrAttachment> makeStencilAttachmentForRenderTarget(const GrRenderTarget* rt,
- SkISize dimensions,
- int numStencilSamples) override;
+ SkISize dimensions) override;
sk_sp<GrAttachment> makeMSAAAttachment(SkISize dimensions,
const GrBackendFormat& format,
diff --git a/src/gpu/glsl/GrGLSLXferProcessor.cpp b/src/gpu/glsl/GrGLSLXferProcessor.cpp
index 1e47648..d81f40f 100644
--- a/src/gpu/glsl/GrGLSLXferProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLXferProcessor.cpp
@@ -151,18 +151,7 @@
const char* outColor,
const char* outColorSecondary,
const GrXferProcessor& proc) {
- if (proc.dstReadUsesMixedSamples()) {
- if (srcCoverage) {
- // TODO: Once we are no longer using legacy mesh ops, it will not be possible to even
- // create a mixed sample with lcd so we can uncomment the below assert. In practice
- // today this never happens except for GLPrograms test which can make one. skia:6661
- // SkASSERT(!proc.isLCD());
- fragBuilder->codeAppendf("%s *= %s;", outColor, srcCoverage);
- fragBuilder->codeAppendf("%s = %s;", outColorSecondary, srcCoverage);
- } else {
- fragBuilder->codeAppendf("%s = half4(1.0);", outColorSecondary);
- }
- } else if (srcCoverage) {
+ if (srcCoverage) {
if (proc.isLCD()) {
fragBuilder->codeAppendf("half3 lerpRGB = mix(%s.aaa, %s.aaa, %s.rgb);",
dstColor, outColor, srcCoverage);
diff --git a/src/gpu/mock/GrMockGpu.cpp b/src/gpu/mock/GrMockGpu.cpp
index 15a76ec..b884a31 100644
--- a/src/gpu/mock/GrMockGpu.cpp
+++ b/src/gpu/mock/GrMockGpu.cpp
@@ -211,9 +211,7 @@
}
sk_sp<GrAttachment> GrMockGpu::makeStencilAttachmentForRenderTarget(const GrRenderTarget* rt,
- SkISize dimensions,
- int numStencilSamples) {
- SkASSERT(numStencilSamples == rt->numSamples());
+ SkISize dimensions) {
fStats.incStencilAttachmentCreates();
return sk_sp<GrAttachment>(
new GrMockAttachment(this, dimensions, GrAttachment::UsageFlags::kStencilAttachment,
diff --git a/src/gpu/mock/GrMockGpu.h b/src/gpu/mock/GrMockGpu.h
index 05064a1..66672b2 100644
--- a/src/gpu/mock/GrMockGpu.h
+++ b/src/gpu/mock/GrMockGpu.h
@@ -144,8 +144,7 @@
}
sk_sp<GrAttachment> makeStencilAttachmentForRenderTarget(const GrRenderTarget*,
- SkISize dimensions,
- int numStencilSamples) override;
+ SkISize dimensions) override;
GrBackendFormat getPreferredStencilFormat(const GrBackendFormat&) override {
return GrBackendFormat::MakeMock(GrColorType::kUnknown, SkImage::CompressionType::kNone,
diff --git a/src/gpu/mtl/GrMtlCaps.mm b/src/gpu/mtl/GrMtlCaps.mm
index 7f2e175..f6ed688 100644
--- a/src/gpu/mtl/GrMtlCaps.mm
+++ b/src/gpu/mtl/GrMtlCaps.mm
@@ -342,7 +342,6 @@
}
}
- fMixedSamplesSupport = false;
fGpuTracingSupport = false;
fFenceSyncSupport = true;
@@ -1105,7 +1104,7 @@
// If ordering here is changed, update getStencilPixelFormat() below
b.add32(programInfo.backendFormat().asMtlFormat());
- b.add32(programInfo.numRasterSamples());
+ b.add32(programInfo.numSamples());
#ifdef SK_DEBUG
if (rt && programInfo.isStencilEnabled()) {
diff --git a/src/gpu/mtl/GrMtlGpu.h b/src/gpu/mtl/GrMtlGpu.h
index 4502050..623251c 100644
--- a/src/gpu/mtl/GrMtlGpu.h
+++ b/src/gpu/mtl/GrMtlGpu.h
@@ -234,7 +234,7 @@
size_t imageBytes, size_t rowBytes);
sk_sp<GrAttachment> makeStencilAttachmentForRenderTarget(
- const GrRenderTarget*, SkISize dimensions, int numStencilSamples) override;
+ const GrRenderTarget*, SkISize dimensions) override;
GrBackendFormat getPreferredStencilFormat(const GrBackendFormat&) override {
return GrBackendFormat::MakeMtl(this->mtlCaps().preferredStencilFormat());
diff --git a/src/gpu/mtl/GrMtlGpu.mm b/src/gpu/mtl/GrMtlGpu.mm
index b43d7a6..d958b73 100644
--- a/src/gpu/mtl/GrMtlGpu.mm
+++ b/src/gpu/mtl/GrMtlGpu.mm
@@ -532,9 +532,8 @@
return true;
}
-sk_sp<GrAttachment> GrMtlGpu::makeStencilAttachmentForRenderTarget(
- const GrRenderTarget* rt, SkISize dimensions, int numStencilSamples) {
- SkASSERT(numStencilSamples == rt->numSamples());
+sk_sp<GrAttachment> GrMtlGpu::makeStencilAttachmentForRenderTarget(const GrRenderTarget* rt,
+ SkISize dimensions) {
SkASSERT(dimensions.width() >= rt->width());
SkASSERT(dimensions.height() >= rt->height());
diff --git a/src/gpu/mtl/GrMtlPipelineStateBuilder.mm b/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
index 67db118..7a0a649 100644
--- a/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
+++ b/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
@@ -525,7 +525,7 @@
pipelineDescriptor.colorAttachments[0] = create_color_attachment(pixelFormat,
programInfo.pipeline(),
writer.get());
- pipelineDescriptor.sampleCount = programInfo.numRasterSamples();
+ pipelineDescriptor.sampleCount = programInfo.numSamples();
GrMtlCaps* mtlCaps = (GrMtlCaps*)this->caps();
pipelineDescriptor.stencilAttachmentPixelFormat = mtlCaps->getStencilPixelFormat(desc);
if (writer) {
diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp
index d252b72..b69fb42 100644
--- a/src/gpu/ops/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp
@@ -740,12 +740,11 @@
FixedFunctionFlags fixedFunctionFlags() const override { return fHelper.fixedFunctionFlags(); }
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
return fHelper.finalizeProcessors(
- caps, clip, hasMixedSampledCoverage, clampType,
- GrProcessorAnalysisCoverage::kSingleChannel, &fPaths.back().fColor, &fWideColor);
+ caps, clip, clampType, GrProcessorAnalysisCoverage::kSingleChannel,
+ &fPaths.back().fColor, &fWideColor);
}
private:
diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
index 912a6b2..bdb733e 100644
--- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
@@ -859,11 +859,10 @@
FixedFunctionFlags fixedFunctionFlags() const override { return fHelper.fixedFunctionFlags(); }
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
// This Op uses uniform (not vertex) color, so doesn't need to track wide color.
- return fHelper.finalizeProcessors(caps, clip, hasMixedSampledCoverage, clampType,
+ return fHelper.finalizeProcessors(caps, clip, clampType,
GrProcessorAnalysisCoverage::kSingleChannel, &fColor,
nullptr);
}
diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
index 0cee751..ac30716 100644
--- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
@@ -189,12 +189,11 @@
FixedFunctionFlags fixedFunctionFlags() const override { return fHelper.fixedFunctionFlags(); }
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
- return fHelper.finalizeProcessors(
- caps, clip, hasMixedSampledCoverage, clampType,
- GrProcessorAnalysisCoverage::kSingleChannel, &fPaths.back().fColor, &fWideColor);
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
+ return fHelper.finalizeProcessors(caps, clip, clampType,
+ GrProcessorAnalysisCoverage::kSingleChannel,
+ &fPaths.back().fColor, &fWideColor);
}
private:
diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp
index 4efb410..bc6f843 100644
--- a/src/gpu/ops/GrAtlasTextOp.cpp
+++ b/src/gpu/ops/GrAtlasTextOp.cpp
@@ -158,9 +158,8 @@
return FixedFunctionFlags::kNone;
}
-GrProcessorSet::Analysis GrAtlasTextOp::finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) {
+GrProcessorSet::Analysis GrAtlasTextOp::finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) {
GrProcessorAnalysisCoverage coverage;
GrProcessorAnalysisColor color;
if (this->maskType() == MaskType::kColorBitmap) {
@@ -187,9 +186,8 @@
break;
}
- auto analysis = fProcessors.finalize(
- color, coverage, clip, &GrUserStencilSettings::kUnused, hasMixedSampledCoverage, caps,
- clampType, &fHead->fColor);
+ auto analysis = fProcessors.finalize(color, coverage, clip, &GrUserStencilSettings::kUnused,
+ caps, clampType, &fHead->fColor);
// TODO(michaelludwig): Once processor analysis can be done external to op creation/finalization
// the atlas op metadata can be fully const. This is okay for now since finalize() happens
// before the op is merged, so during combineIfPossible, metadata is effectively const.
diff --git a/src/gpu/ops/GrAtlasTextOp.h b/src/gpu/ops/GrAtlasTextOp.h
index 0a8710b..2d18965 100644
--- a/src/gpu/ops/GrAtlasTextOp.h
+++ b/src/gpu/ops/GrAtlasTextOp.h
@@ -100,8 +100,7 @@
FixedFunctionFlags fixedFunctionFlags() const override;
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override;
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override;
enum class MaskType : uint32_t {
kGrayscaleCoverage,
diff --git a/src/gpu/ops/GrDashOp.cpp b/src/gpu/ops/GrDashOp.cpp
index ca29f73..e7eaad8 100644
--- a/src/gpu/ops/GrDashOp.cpp
+++ b/src/gpu/ops/GrDashOp.cpp
@@ -253,13 +253,11 @@
return flags;
}
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
GrProcessorAnalysisCoverage coverage = GrProcessorAnalysisCoverage::kSingleChannel;
- auto analysis = fProcessorSet.finalize(
- fColor, coverage, clip, fStencilSettings, hasMixedSampledCoverage, caps, clampType,
- &fColor);
+ auto analysis = fProcessorSet.finalize(fColor, coverage, clip, fStencilSettings, caps,
+ clampType, &fColor);
fUsesLocalCoords = analysis.usesLocalCoords();
return analysis;
}
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index e40ccc0..5ca9e70 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -404,15 +404,13 @@
FixedFunctionFlags fixedFunctionFlags() const override { return fHelper.fixedFunctionFlags(); }
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
GrProcessorAnalysisCoverage gpCoverage =
this->coverage() == 0xFF ? GrProcessorAnalysisCoverage::kNone
: GrProcessorAnalysisCoverage::kSingleChannel;
// This Op uses uniform (not vertex) color, so doesn't need to track wide color.
- return fHelper.finalizeProcessors(
- caps, clip, hasMixedSampledCoverage, clampType, gpCoverage, &fColor, nullptr);
+ return fHelper.finalizeProcessors(caps, clip, clampType, gpCoverage, &fColor, nullptr);
}
private:
diff --git a/src/gpu/ops/GrDrawAtlasOp.cpp b/src/gpu/ops/GrDrawAtlasOp.cpp
index 1138ca8..7d6405b 100644
--- a/src/gpu/ops/GrDrawAtlasOp.cpp
+++ b/src/gpu/ops/GrDrawAtlasOp.cpp
@@ -46,8 +46,7 @@
FixedFunctionFlags fixedFunctionFlags() const override;
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override;
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override;
private:
GrProgramInfo* programInfo() override { return fProgramInfo; }
@@ -285,16 +284,15 @@
return fHelper.fixedFunctionFlags();
}
-GrProcessorSet::Analysis DrawAtlasOp::finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) {
+GrProcessorSet::Analysis DrawAtlasOp::finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) {
GrProcessorAnalysisColor gpColor;
if (this->hasColors()) {
gpColor.setToUnknown();
} else {
gpColor.setToConstant(fColor);
}
- auto result = fHelper.finalizeProcessors(caps, clip, hasMixedSampledCoverage, clampType,
+ auto result = fHelper.finalizeProcessors(caps, clip, clampType,
GrProcessorAnalysisCoverage::kNone, &gpColor);
if (gpColor.isConstant(&fColor)) {
fHasColors = false;
diff --git a/src/gpu/ops/GrDrawOp.h b/src/gpu/ops/GrDrawOp.h
index f023eb3..788e47c 100644
--- a/src/gpu/ops/GrDrawOp.h
+++ b/src/gpu/ops/GrDrawOp.h
@@ -28,7 +28,7 @@
*/
enum class FixedFunctionFlags : uint32_t {
kNone = 0x0,
- /** Indices that the op will enable MSAA or mixed samples rendering. */
+ /** Indices that the op will enable MSAA. */
kUsesHWAA = 0x1,
/** Indices that the op reads and/or writes the stencil buffer */
kUsesStencil = 0x2,
@@ -43,8 +43,7 @@
* at this time the op must report whether a copy of the destination (or destination texture
* itself) needs to be provided to the GrXferProcessor when this op executes.
*/
- virtual GrProcessorSet::Analysis finalize(
- const GrCaps&, const GrAppliedClip*, bool hasMixedSampledCoverage, GrClampType) = 0;
+ virtual GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) = 0;
#ifdef SK_DEBUG
bool fAddDrawOpCalled = false;
diff --git a/src/gpu/ops/GrDrawVerticesOp.cpp b/src/gpu/ops/GrDrawVerticesOp.cpp
index 29ce6ed..a5a6439 100644
--- a/src/gpu/ops/GrDrawVerticesOp.cpp
+++ b/src/gpu/ops/GrDrawVerticesOp.cpp
@@ -226,8 +226,7 @@
FixedFunctionFlags fixedFunctionFlags() const override;
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override;
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override;
private:
GrProgramInfo* programInfo() override { return fProgramInfo; }
@@ -360,16 +359,15 @@
return fHelper.fixedFunctionFlags();
}
-GrProcessorSet::Analysis DrawVerticesOp::finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) {
+GrProcessorSet::Analysis DrawVerticesOp::finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) {
GrProcessorAnalysisColor gpColor;
if (this->requiresPerVertexColors()) {
gpColor.setToUnknown();
} else {
gpColor.setToConstant(fMeshes.front().fColor);
}
- auto result = fHelper.finalizeProcessors(caps, clip, hasMixedSampledCoverage, clampType,
+ auto result = fHelper.finalizeProcessors(caps, clip, clampType,
GrProcessorAnalysisCoverage::kNone, &gpColor);
if (gpColor.isConstant(&fMeshes.front().fColor)) {
fMeshes.front().fIgnoreColors = true;
diff --git a/src/gpu/ops/GrFillRRectOp.cpp b/src/gpu/ops/GrFillRRectOp.cpp
index 38ff2c0..b3f1080 100644
--- a/src/gpu/ops/GrFillRRectOp.cpp
+++ b/src/gpu/ops/GrFillRRectOp.cpp
@@ -42,8 +42,7 @@
FixedFunctionFlags fixedFunctionFlags() const final { return fHelper.fixedFunctionFlags(); }
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) final;
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) final;
CombineResult onCombineIfPossible(GrOp*, SkArenaAlloc*, const GrCaps&) final;
void visitProxies(const VisitProxyFunc& fn) const override {
@@ -234,15 +233,14 @@
// We will write the color and local rect attribs during finalize().
}
-GrProcessorSet::Analysis FillRRectOp::finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) {
+GrProcessorSet::Analysis FillRRectOp::finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) {
SkASSERT(1 == fInstanceCount);
bool isWideColor;
- auto analysis = fHelper.finalizeProcessors(caps, clip, hasMixedSampledCoverage, clampType,
- GrProcessorAnalysisCoverage::kSingleChannel,
- &fColor, &isWideColor);
+ auto analysis = fHelper.finalizeProcessors(caps, clip, clampType,
+ GrProcessorAnalysisCoverage::kSingleChannel, &fColor,
+ &isWideColor);
// Finish writing the instance attribs.
if (isWideColor) {
diff --git a/src/gpu/ops/GrFillRectOp.cpp b/src/gpu/ops/GrFillRectOp.cpp
index 57ea5ba..93052d2 100644
--- a/src/gpu/ops/GrFillRectOp.cpp
+++ b/src/gpu/ops/GrFillRectOp.cpp
@@ -120,9 +120,8 @@
}
}
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
// Initialize aggregate color analysis with the first quad's color (which always exists)
auto iter = fQuads.metadata();
SkAssertResult(iter.next());
@@ -142,8 +141,7 @@
auto coverage = fHelper.aaType() == GrAAType::kCoverage
? GrProcessorAnalysisCoverage::kSingleChannel
: GrProcessorAnalysisCoverage::kNone;
- auto result = fHelper.finalizeProcessors(
- caps, clip, hasMixedSampledCoverage, clampType, coverage, &quadColors);
+ auto result = fHelper.finalizeProcessors(caps, clip, clampType, coverage, &quadColors);
// If there is a constant color after analysis, that means all of the quads should be set
// to the same color (even if they started out with different colors).
iter = fQuads.metadata();
diff --git a/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp
index 00ea878..97e4fd4 100644
--- a/src/gpu/ops/GrLatticeOp.cpp
+++ b/src/gpu/ops/GrLatticeOp.cpp
@@ -177,16 +177,15 @@
FixedFunctionFlags fixedFunctionFlags() const override { return fHelper.fixedFunctionFlags(); }
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
auto opaque = fPatches[0].fColor.isOpaque() && fAlphaType == kOpaque_SkAlphaType
? GrProcessorAnalysisColor::Opaque::kYes
: GrProcessorAnalysisColor::Opaque::kNo;
auto analysisColor = GrProcessorAnalysisColor(opaque);
- auto result = fHelper.finalizeProcessors(
- caps, clip, hasMixedSampledCoverage, clampType, GrProcessorAnalysisCoverage::kNone,
- &analysisColor);
+ auto result = fHelper.finalizeProcessors(caps, clip, clampType,
+ GrProcessorAnalysisCoverage::kNone,
+ &analysisColor);
analysisColor.isConstant(&fPatches[0].fColor);
fWideColor = !fPatches[0].fColor.fitsInBytes();
return result;
diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp
index 1dd1799..e5ab493 100644
--- a/src/gpu/ops/GrOvalOpFactory.cpp
+++ b/src/gpu/ops/GrOvalOpFactory.cpp
@@ -1254,11 +1254,10 @@
}
}
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
SkPMColor4f* color = &fCircles.front().fColor;
- return fHelper.finalizeProcessors(caps, clip, hasMixedSampledCoverage, clampType,
+ return fHelper.finalizeProcessors(caps, clip, clampType,
GrProcessorAnalysisCoverage::kSingleChannel, color,
&fWideColor);
}
@@ -1617,11 +1616,10 @@
}
}
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
SkPMColor4f* color = &fCircles.front().fColor;
- return fHelper.finalizeProcessors(caps, clip, hasMixedSampledCoverage, clampType,
+ return fHelper.finalizeProcessors(caps, clip, clampType,
GrProcessorAnalysisCoverage::kSingleChannel, color,
&fWideColor);
}
@@ -1949,13 +1947,12 @@
}
}
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
fUseScale = !caps.shaderCaps()->floatIs32Bits() &&
!caps.shaderCaps()->hasLowFragmentPrecision();
SkPMColor4f* color = &fEllipses.front().fColor;
- return fHelper.finalizeProcessors(caps, clip, hasMixedSampledCoverage, clampType,
+ return fHelper.finalizeProcessors(caps, clip, clampType,
GrProcessorAnalysisCoverage::kSingleChannel, color,
&fWideColor);
}
@@ -2226,13 +2223,12 @@
}
}
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
fUseScale = !caps.shaderCaps()->floatIs32Bits() &&
!caps.shaderCaps()->hasLowFragmentPrecision();
SkPMColor4f* color = &fEllipses.front().fColor;
- return fHelper.finalizeProcessors(caps, clip, hasMixedSampledCoverage, clampType,
+ return fHelper.finalizeProcessors(caps, clip, clampType,
GrProcessorAnalysisCoverage::kSingleChannel, color,
&fWideColor);
}
@@ -2577,11 +2573,10 @@
}
}
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
SkPMColor4f* color = &fRRects.front().fColor;
- return fHelper.finalizeProcessors(caps, clip, hasMixedSampledCoverage, clampType,
+ return fHelper.finalizeProcessors(caps, clip, clampType,
GrProcessorAnalysisCoverage::kSingleChannel, color,
&fWideColor);
}
@@ -2950,12 +2945,11 @@
}
}
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
fUseScale = !caps.shaderCaps()->floatIs32Bits();
SkPMColor4f* color = &fRRects.front().fColor;
- return fHelper.finalizeProcessors(caps, clip, hasMixedSampledCoverage, clampType,
+ return fHelper.finalizeProcessors(caps, clip, clampType,
GrProcessorAnalysisCoverage::kSingleChannel, color,
&fWideColor);
}
diff --git a/src/gpu/ops/GrRegionOp.cpp b/src/gpu/ops/GrRegionOp.cpp
index 5401f47..9ec8ce9 100644
--- a/src/gpu/ops/GrRegionOp.cpp
+++ b/src/gpu/ops/GrRegionOp.cpp
@@ -74,12 +74,10 @@
FixedFunctionFlags fixedFunctionFlags() const override { return fHelper.fixedFunctionFlags(); }
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
- return fHelper.finalizeProcessors(
- caps, clip, hasMixedSampledCoverage, clampType, GrProcessorAnalysisCoverage::kNone,
- &fRegions[0].fColor, &fWideColor);
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
+ return fHelper.finalizeProcessors(caps, clip, clampType, GrProcessorAnalysisCoverage::kNone,
+ &fRegions[0].fColor, &fWideColor);
}
private:
diff --git a/src/gpu/ops/GrShadowRRectOp.cpp b/src/gpu/ops/GrShadowRRectOp.cpp
index e24beac..0d272ae 100644
--- a/src/gpu/ops/GrShadowRRectOp.cpp
+++ b/src/gpu/ops/GrShadowRRectOp.cpp
@@ -242,8 +242,7 @@
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override {
return GrProcessorSet::EmptySetAnalysis();
}
diff --git a/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp b/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp
index 70e028c..743b435 100644
--- a/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp
+++ b/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp
@@ -68,12 +68,10 @@
}
GrProcessorSet::Analysis GrSimpleMeshDrawOpHelper::finalizeProcessors(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType, GrProcessorAnalysisCoverage geometryCoverage,
- SkPMColor4f* geometryColor, bool* wideColor) {
+ const GrCaps& caps, const GrAppliedClip* clip, GrClampType clampType,
+ GrProcessorAnalysisCoverage geometryCoverage, SkPMColor4f* geometryColor, bool* wideColor) {
GrProcessorAnalysisColor color = *geometryColor;
- auto result = this->finalizeProcessors(
- caps, clip, hasMixedSampledCoverage, clampType, geometryCoverage, &color);
+ auto result = this->finalizeProcessors(caps, clip, clampType, geometryCoverage, &color);
color.isConstant(geometryColor);
if (wideColor) {
*wideColor = !geometryColor->fitsInBytes();
@@ -83,8 +81,8 @@
GrProcessorSet::Analysis GrSimpleMeshDrawOpHelper::finalizeProcessors(
const GrCaps& caps, const GrAppliedClip* clip, const GrUserStencilSettings* userStencil,
- bool hasMixedSampledCoverage, GrClampType clampType,
- GrProcessorAnalysisCoverage geometryCoverage, GrProcessorAnalysisColor* geometryColor) {
+ GrClampType clampType, GrProcessorAnalysisCoverage geometryCoverage,
+ GrProcessorAnalysisColor* geometryColor) {
SkDEBUGCODE(fDidAnalysis = true);
GrProcessorSet::Analysis analysis;
if (fProcessors) {
@@ -95,8 +93,8 @@
: GrProcessorAnalysisCoverage::kNone;
}
SkPMColor4f overrideColor;
- analysis = fProcessors->finalize(*geometryColor, coverage, clip, userStencil,
- hasMixedSampledCoverage, caps, clampType, &overrideColor);
+ analysis = fProcessors->finalize(*geometryColor, coverage, clip, userStencil, caps,
+ clampType, &overrideColor);
if (analysis.inputColorIsOverridden()) {
*geometryColor = overrideColor;
}
diff --git a/src/gpu/ops/GrSimpleMeshDrawOpHelper.h b/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
index 8ea2390..0c39a5f 100644
--- a/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
+++ b/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
@@ -67,13 +67,12 @@
* this may be set to a known color in which case the op must output this
* color from its geometry processor instead.
*/
- GrProcessorSet::Analysis finalizeProcessors(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType, GrProcessorAnalysisCoverage geometryCoverage,
- GrProcessorAnalysisColor* geometryColor) {
- return this->finalizeProcessors(
- caps, clip, &GrUserStencilSettings::kUnused, hasMixedSampledCoverage, clampType,
- geometryCoverage, geometryColor);
+ GrProcessorSet::Analysis finalizeProcessors(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType,
+ GrProcessorAnalysisCoverage geometryCoverage,
+ GrProcessorAnalysisColor* geometryColor) {
+ return this->finalizeProcessors(caps, clip, &GrUserStencilSettings::kUnused, clampType,
+ geometryCoverage, geometryColor);
}
/**
@@ -81,10 +80,9 @@
* output. The op passes this color as 'geometryColor' and after return if 'geometryColor' has
* changed the op must override its geometry processor color output with the new color.
*/
- GrProcessorSet::Analysis finalizeProcessors(
- const GrCaps&, const GrAppliedClip*, bool hasMixedSampledCoverage, GrClampType,
- GrProcessorAnalysisCoverage geometryCoverage, SkPMColor4f* geometryColor,
- bool* wideColor);
+ GrProcessorSet::Analysis finalizeProcessors(const GrCaps&, const GrAppliedClip*, GrClampType,
+ GrProcessorAnalysisCoverage geometryCoverage,
+ SkPMColor4f* geometryColor, bool* wideColor);
bool isTrivial() const {
return fProcessors == nullptr;
@@ -178,10 +176,10 @@
GrPipeline::InputFlags pipelineFlags() const { return fPipelineFlags; }
protected:
- GrProcessorSet::Analysis finalizeProcessors(
- const GrCaps& caps, const GrAppliedClip*, const GrUserStencilSettings*,
- bool hasMixedSampledCoverage, GrClampType, GrProcessorAnalysisCoverage geometryCoverage,
- GrProcessorAnalysisColor* geometryColor);
+ GrProcessorSet::Analysis finalizeProcessors(const GrCaps& caps, const GrAppliedClip*,
+ const GrUserStencilSettings*, GrClampType,
+ GrProcessorAnalysisCoverage geometryCoverage,
+ GrProcessorAnalysisColor* geometryColor);
GrProcessorSet* fProcessors;
GrPipeline::InputFlags fPipelineFlags;
diff --git a/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.cpp b/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.cpp
index 936fb52..3c24b26 100644
--- a/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.cpp
+++ b/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.cpp
@@ -24,12 +24,10 @@
}
GrProcessorSet::Analysis GrSimpleMeshDrawOpHelperWithStencil::finalizeProcessors(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType, GrProcessorAnalysisCoverage geometryCoverage,
- SkPMColor4f* geometryColor, bool* wideColor) {
+ const GrCaps& caps, const GrAppliedClip* clip, GrClampType clampType,
+ GrProcessorAnalysisCoverage geometryCoverage, SkPMColor4f* geometryColor, bool* wideColor) {
GrProcessorAnalysisColor color = *geometryColor;
- auto result = this->finalizeProcessors(
- caps, clip, hasMixedSampledCoverage, clampType, geometryCoverage, &color);
+ auto result = this->finalizeProcessors(caps, clip, clampType, geometryCoverage, &color);
color.isConstant(geometryColor);
if (wideColor) {
*wideColor = !geometryColor->fitsInBytes();
diff --git a/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h b/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h
index 575b23f..787e414 100644
--- a/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h
+++ b/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h
@@ -45,19 +45,17 @@
GrDrawOp::FixedFunctionFlags fixedFunctionFlags() const;
- GrProcessorSet::Analysis finalizeProcessors(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType, GrProcessorAnalysisCoverage geometryCoverage,
- GrProcessorAnalysisColor* geometryColor) {
- return this->INHERITED::finalizeProcessors(
- caps, clip, fStencilSettings, hasMixedSampledCoverage, clampType, geometryCoverage,
- geometryColor);
+ GrProcessorSet::Analysis finalizeProcessors(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType,
+ GrProcessorAnalysisCoverage geometryCoverage,
+ GrProcessorAnalysisColor* geometryColor) {
+ return this->INHERITED::finalizeProcessors(caps, clip, fStencilSettings, clampType,
+ geometryCoverage, geometryColor);
}
- GrProcessorSet::Analysis finalizeProcessors(
- const GrCaps&, const GrAppliedClip*, bool hasMixedSampledCoverage, GrClampType,
- GrProcessorAnalysisCoverage geometryCoverage, SkPMColor4f* geometryColor, bool*
- wideColor);
+ GrProcessorSet::Analysis finalizeProcessors(const GrCaps&, const GrAppliedClip*, GrClampType,
+ GrProcessorAnalysisCoverage geometryCoverage,
+ SkPMColor4f* geometryColor, bool* wideColor);
using GrSimpleMeshDrawOpHelper::aaType;
using GrSimpleMeshDrawOpHelper::setAAType;
diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp
index 982fe24..70b1798 100644
--- a/src/gpu/ops/GrSmallPathRenderer.cpp
+++ b/src/gpu/ops/GrSmallPathRenderer.cpp
@@ -138,12 +138,11 @@
FixedFunctionFlags fixedFunctionFlags() const override { return fHelper.fixedFunctionFlags(); }
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
- return fHelper.finalizeProcessors(
- caps, clip, hasMixedSampledCoverage, clampType,
- GrProcessorAnalysisCoverage::kSingleChannel, &fShapes.front().fColor, &fWideColor);
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
+ return fHelper.finalizeProcessors(caps, clip, clampType,
+ GrProcessorAnalysisCoverage::kSingleChannel,
+ &fShapes.front().fColor, &fWideColor);
}
private:
diff --git a/src/gpu/ops/GrStrokeRectOp.cpp b/src/gpu/ops/GrStrokeRectOp.cpp
index cfad2bd..41a99d8 100644
--- a/src/gpu/ops/GrStrokeRectOp.cpp
+++ b/src/gpu/ops/GrStrokeRectOp.cpp
@@ -159,12 +159,11 @@
FixedFunctionFlags fixedFunctionFlags() const override { return fHelper.fixedFunctionFlags(); }
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
// This Op uses uniform (not vertex) color, so doesn't need to track wide color.
- return fHelper.finalizeProcessors(caps, clip, hasMixedSampledCoverage, clampType,
- GrProcessorAnalysisCoverage::kNone, &fColor, nullptr);
+ return fHelper.finalizeProcessors(caps, clip, clampType, GrProcessorAnalysisCoverage::kNone,
+ &fColor, nullptr);
}
private:
@@ -428,12 +427,11 @@
FixedFunctionFlags fixedFunctionFlags() const override { return fHelper.fixedFunctionFlags(); }
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
- return fHelper.finalizeProcessors(
- caps, clip, hasMixedSampledCoverage, clampType,
- GrProcessorAnalysisCoverage::kSingleChannel, &fRects.back().fColor, &fWideColor);
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
+ return fHelper.finalizeProcessors(caps, clip, clampType,
+ GrProcessorAnalysisCoverage::kSingleChannel,
+ &fRects.back().fColor, &fWideColor);
}
private:
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp
index 98ad665..94c7092 100644
--- a/src/gpu/ops/GrTextureOp.cpp
+++ b/src/gpu/ops/GrTextureOp.cpp
@@ -287,9 +287,8 @@
}
#endif
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip*, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip*,
+ GrClampType clampType) override {
SkASSERT(fMetadata.colorType() == ColorType::kNone);
auto iter = fQuads.metadata();
while(iter.next()) {
diff --git a/src/gpu/ops/GrTriangulatingPathRenderer.cpp b/src/gpu/ops/GrTriangulatingPathRenderer.cpp
index 85f7ad1..d2ae4fd 100644
--- a/src/gpu/ops/GrTriangulatingPathRenderer.cpp
+++ b/src/gpu/ops/GrTriangulatingPathRenderer.cpp
@@ -282,15 +282,13 @@
FixedFunctionFlags fixedFunctionFlags() const override { return fHelper.fixedFunctionFlags(); }
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
GrProcessorAnalysisCoverage coverage = fAntiAlias
? GrProcessorAnalysisCoverage::kSingleChannel
: GrProcessorAnalysisCoverage::kNone;
// This Op uses uniform (not vertex) color, so doesn't need to track wide color.
- return fHelper.finalizeProcessors(
- caps, clip, hasMixedSampledCoverage, clampType, coverage, &fColor, nullptr);
+ return fHelper.finalizeProcessors(caps, clip, clampType, coverage, &fColor, nullptr);
}
private:
diff --git a/src/gpu/tessellate/GrDrawAtlasPathOp.cpp b/src/gpu/tessellate/GrDrawAtlasPathOp.cpp
index d2d5b77..5ecb058 100644
--- a/src/gpu/tessellate/GrDrawAtlasPathOp.cpp
+++ b/src/gpu/tessellate/GrDrawAtlasPathOp.cpp
@@ -115,12 +115,10 @@
} // namespace
GrProcessorSet::Analysis GrDrawAtlasPathOp::finalize(const GrCaps& caps, const GrAppliedClip* clip,
- bool hasMixedSampledCoverage,
GrClampType clampType) {
const GrProcessorSet::Analysis& analysis = fProcessors.finalize(
fInstanceList.fInstance.fColor, GrProcessorAnalysisCoverage::kSingleChannel, clip,
- &GrUserStencilSettings::kUnused, hasMixedSampledCoverage, caps, clampType,
- &fInstanceList.fInstance.fColor);
+ &GrUserStencilSettings::kUnused, caps, clampType, &fInstanceList.fInstance.fColor);
fUsesLocalCoords = analysis.usesLocalCoords();
return analysis;
}
diff --git a/src/gpu/tessellate/GrDrawAtlasPathOp.h b/src/gpu/tessellate/GrDrawAtlasPathOp.h
index 91b0f40..ca2ad93 100644
--- a/src/gpu/tessellate/GrDrawAtlasPathOp.h
+++ b/src/gpu/tessellate/GrDrawAtlasPathOp.h
@@ -35,8 +35,7 @@
fn(fAtlasProxy.get(), GrMipmapped::kNo);
fProcessors.visitProxies(fn);
}
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override;
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override;
CombineResult onCombineIfPossible(GrOp*, SkArenaAlloc*, const GrCaps&) override;
void onPrepare(GrOpFlushState*) override;
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
diff --git a/src/gpu/tessellate/GrFillPathShader.h b/src/gpu/tessellate/GrFillPathShader.h
index 0be7346..d552098 100644
--- a/src/gpu/tessellate/GrFillPathShader.h
+++ b/src/gpu/tessellate/GrFillPathShader.h
@@ -30,20 +30,7 @@
GrProcessorSet&& processors) {
auto pipelineFlags = GrPipeline::InputFlags::kNone;
if (aaType != GrAAType::kNone) {
- if (args.fWriteView.asRenderTargetProxy()->numSamples() == 1) {
- // We are mixed sampled. We need to either enable conservative raster (preferred) or
- // disable MSAA in order to avoid double blend artifacts. (Even if we disable MSAA for
- // the cover geometry, the stencil test is still multisampled and will still produce
- // smooth results.)
- SkASSERT(aaType == GrAAType::kCoverage);
- if (args.fCaps->conservativeRasterSupport()) {
- pipelineFlags |= GrPipeline::InputFlags::kHWAntialias;
- pipelineFlags |= GrPipeline::InputFlags::kConservativeRaster;
- }
- } else {
- // We are standard MSAA. Leave MSAA enabled for the cover geometry.
- pipelineFlags |= GrPipeline::InputFlags::kHWAntialias;
- }
+ pipelineFlags |= GrPipeline::InputFlags::kHWAntialias;
}
return GrSimpleMeshDrawOpHelper::CreatePipeline(
args.fCaps, args.fArena, args.fWriteView.swizzle(), std::move(appliedClip),
diff --git a/src/gpu/tessellate/GrPathInnerTriangulateOp.cpp b/src/gpu/tessellate/GrPathInnerTriangulateOp.cpp
index 6d29b0a..98074c7 100644
--- a/src/gpu/tessellate/GrPathInnerTriangulateOp.cpp
+++ b/src/gpu/tessellate/GrPathInnerTriangulateOp.cpp
@@ -36,10 +36,9 @@
GrProcessorSet::Analysis GrPathInnerTriangulateOp::finalize(const GrCaps& caps,
const GrAppliedClip* clip,
- bool hasMixedSampledCoverage,
GrClampType clampType) {
- return fProcessors.finalize(fColor, GrProcessorAnalysisCoverage::kNone, clip, nullptr,
- hasMixedSampledCoverage, caps, clampType, &fColor);
+ return fProcessors.finalize(fColor, GrProcessorAnalysisCoverage::kNone, clip, nullptr, caps,
+ clampType, &fColor);
}
void GrPathInnerTriangulateOp::pushFanStencilProgram(const GrPathShader::ProgramArgs& args,
@@ -71,10 +70,9 @@
return;
}
- // If using wireframe or mixed samples, we have to fall back on a standard Redbook "stencil then
- // fill" algorithm instead of bypassing the stencil buffer to fill the fan directly.
- bool forceRedbookStencilPass = (fOpFlags & (OpFlags::kStencilOnly | OpFlags::kWireframe)) ||
- fAAType == GrAAType::kCoverage; // i.e., mixed samples!
+ // If using wireframe, we have to fall back on a standard Redbook "stencil then fill" algorithm
+ // instead of bypassing the stencil buffer to fill the fan directly.
+ bool forceRedbookStencilPass = (fOpFlags & (OpFlags::kStencilOnly | OpFlags::kWireframe));
bool doFill = !(fOpFlags & OpFlags::kStencilOnly);
bool isLinear;
diff --git a/src/gpu/tessellate/GrPathInnerTriangulateOp.h b/src/gpu/tessellate/GrPathInnerTriangulateOp.h
index 70ffa7f..95528d1 100644
--- a/src/gpu/tessellate/GrPathInnerTriangulateOp.h
+++ b/src/gpu/tessellate/GrPathInnerTriangulateOp.h
@@ -38,14 +38,13 @@
, fProcessors(std::move(paint)) {
SkRect devBounds;
fViewMatrix.mapRect(&devBounds, path.getBounds());
- this->setBounds(devBounds, HasAABloat(GrAAType::kCoverage == fAAType), IsHairline::kNo);
+ this->setBounds(devBounds, HasAABloat::kNo, IsHairline::kNo);
}
const char* name() const override { return "GrPathInnerTriangulateOp"; }
void visitProxies(const VisitProxyFunc& fn) const override;
FixedFunctionFlags fixedFunctionFlags() const override;
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override;
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override;
// These calls set up the stencil & fill programs we will use prior to preparing and executing.
void pushFanStencilProgram(const GrPathShader::ProgramArgs&,
diff --git a/src/gpu/tessellate/GrStrokeTessellateOp.cpp b/src/gpu/tessellate/GrStrokeTessellateOp.cpp
index 32552f8..ef0f152 100644
--- a/src/gpu/tessellate/GrStrokeTessellateOp.cpp
+++ b/src/gpu/tessellate/GrStrokeTessellateOp.cpp
@@ -35,7 +35,7 @@
float inflationRadius = stroke.getInflationRadius();
devBounds.outset(inflationRadius, inflationRadius);
viewMatrix.mapRect(&devBounds, devBounds);
- this->setBounds(devBounds, HasAABloat(GrAAType::kCoverage == fAAType), IsHairline::kNo);
+ this->setBounds(devBounds, HasAABloat::kNo, IsHairline::kNo);
}
void GrStrokeTessellateOp::visitProxies(const VisitProxyFunc& fn) const {
@@ -60,15 +60,12 @@
GrProcessorSet::Analysis GrStrokeTessellateOp::finalize(const GrCaps& caps,
const GrAppliedClip* clip,
- bool hasMixedSampledCoverage,
GrClampType clampType) {
// Make sure the finalize happens before combining. We might change fNeedsStencil here.
SkASSERT(fPathStrokeList.fNext == nullptr);
- SkASSERT(fAAType != GrAAType::kCoverage || hasMixedSampledCoverage);
const GrProcessorSet::Analysis& analysis = fProcessors.finalize(
this->headColor(), GrProcessorAnalysisCoverage::kNone, clip,
- &GrUserStencilSettings::kUnused, hasMixedSampledCoverage, caps, clampType,
- &this->headColor());
+ &GrUserStencilSettings::kUnused, caps, clampType, &this->headColor());
fNeedsStencil = !analysis.unaffectedByDstValue();
return analysis;
}
@@ -204,30 +201,17 @@
fTessellator = headTessellator;
}
- // If we are mixed sampled then we need a separate pipeline for the stencil pass. This is
- // because mixed samples either needs conservative raster enabled or MSAA disabled during fill.
- const GrPipeline* mixedSampledStencilPipeline = nullptr;
- if (fAAType == GrAAType::kCoverage) {
- SkASSERT(args.fWriteView.asRenderTargetProxy()->numSamples() == 1);
- SkASSERT(fNeedsStencil); // Mixed samples always needs stencil.
- mixedSampledStencilPipeline = GrStencilPathShader::MakeStencilPassPipeline(
- args, fAAType, GrTessellationPathRenderer::OpFlags::kNone, clip.hardClip());
- }
-
- auto* fillPipeline = GrFillPathShader::MakeFillPassPipeline(args, fAAType, std::move(clip),
- std::move(fProcessors));
+ auto* pipeline = GrFillPathShader::MakeFillPassPipeline(args, fAAType, std::move(clip),
+ std::move(fProcessors));
auto fillStencil = &GrUserStencilSettings::kUnused;
if (fNeedsStencil) {
- auto* stencilPipeline = (mixedSampledStencilPipeline) ? mixedSampledStencilPipeline
- : fillPipeline;
- fStencilProgram = GrPathShader::MakeProgram(args, fTessellator->shader(), stencilPipeline,
+ fStencilProgram = GrPathShader::MakeProgram(args, fTessellator->shader(), pipeline,
&kMarkStencil);
fillStencil = &kTestAndResetStencil;
args.fXferBarrierFlags = GrXferBarrierFlags::kNone;
}
- fFillProgram = GrPathShader::MakeProgram(args, fTessellator->shader(), fillPipeline,
- fillStencil);
+ fFillProgram = GrPathShader::MakeProgram(args, fTessellator->shader(), pipeline, fillStencil);
}
void GrStrokeTessellateOp::onPrePrepare(GrRecordingContext* context,
diff --git a/src/gpu/tessellate/GrStrokeTessellateOp.h b/src/gpu/tessellate/GrStrokeTessellateOp.h
index 33f521b..bb2724f 100644
--- a/src/gpu/tessellate/GrStrokeTessellateOp.h
+++ b/src/gpu/tessellate/GrStrokeTessellateOp.h
@@ -54,8 +54,7 @@
const char* name() const override { return "GrStrokeTessellateOp"; }
void visitProxies(const VisitProxyFunc& fn) const override;
FixedFunctionFlags fixedFunctionFlags() const override;
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override;
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override;
CombineResult onCombineIfPossible(GrOp*, SkArenaAlloc*, const GrCaps&) override;
// Creates the tessellator and the stencil/fill program(s) we will use with it.
diff --git a/src/gpu/tessellate/GrTessellatingStencilFillOp.cpp b/src/gpu/tessellate/GrTessellatingStencilFillOp.cpp
index 71f7b5e..6a23adb 100644
--- a/src/gpu/tessellate/GrTessellatingStencilFillOp.cpp
+++ b/src/gpu/tessellate/GrTessellatingStencilFillOp.cpp
@@ -36,10 +36,9 @@
GrProcessorSet::Analysis GrTessellatingStencilFillOp::finalize(const GrCaps& caps,
const GrAppliedClip* clip,
- bool hasMixedSampledCoverage,
GrClampType clampType) {
- return fProcessors.finalize(fColor, GrProcessorAnalysisCoverage::kNone, clip, nullptr,
- hasMixedSampledCoverage, caps, clampType, &fColor);
+ return fProcessors.finalize(fColor, GrProcessorAnalysisCoverage::kNone, clip, nullptr, caps,
+ clampType, &fColor);
}
void GrTessellatingStencilFillOp::prePreparePrograms(const GrPathShader::ProgramArgs& args,
diff --git a/src/gpu/tessellate/GrTessellatingStencilFillOp.h b/src/gpu/tessellate/GrTessellatingStencilFillOp.h
index b716f31..ec2e83d 100644
--- a/src/gpu/tessellate/GrTessellatingStencilFillOp.h
+++ b/src/gpu/tessellate/GrTessellatingStencilFillOp.h
@@ -15,8 +15,8 @@
class GrPathTessellator;
// Draws paths using a standard Redbook "stencil then fill" method. Curves get linearized by either
-// GPU tessellation shaders or indirect draws. This Op doesn't apply analytic AA, so it requires a
-// render target that supports either MSAA or mixed samples if AA is desired.
+// GPU tessellation shaders or indirect draws. This Op doesn't apply analytic AA, so it requires
+// MSAA if AA is desired.
class GrTessellatingStencilFillOp : public GrDrawOp {
private:
DEFINE_OP_CLASS_ID
@@ -32,14 +32,13 @@
, fProcessors(std::move(paint)) {
SkRect devBounds;
fViewMatrix.mapRect(&devBounds, path.getBounds());
- this->setBounds(devBounds, HasAABloat(GrAAType::kCoverage == fAAType), IsHairline::kNo);
+ this->setBounds(devBounds, HasAABloat::kNo, IsHairline::kNo);
}
const char* name() const override { return "GrTessellatingStencilFillOp"; }
void visitProxies(const VisitProxyFunc& fn) const override;
FixedFunctionFlags fixedFunctionFlags() const override;
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override;
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override;
// Chooses the rendering method we will use and creates the corresponding tessellator and
// stencil/fill programs.
diff --git a/src/gpu/tessellate/GrTessellationPathRenderer.cpp b/src/gpu/tessellate/GrTessellationPathRenderer.cpp
index 7437de1..a36c837 100644
--- a/src/gpu/tessellate/GrTessellationPathRenderer.cpp
+++ b/src/gpu/tessellate/GrTessellationPathRenderer.cpp
@@ -128,19 +128,14 @@
GrPathRenderer::CanDrawPath GrTessellationPathRenderer::onCanDrawPath(
const CanDrawPathArgs& args) const {
const GrStyledShape& shape = *args.fShape;
- if (shape.style().hasPathEffect() ||
+ if (args.fAAType == GrAAType::kCoverage ||
+ shape.style().hasPathEffect() ||
args.fViewMatrix->hasPerspective() ||
shape.style().strokeRec().getStyle() == SkStrokeRec::kStrokeAndFill_Style ||
shape.inverseFilled() ||
args.fHasUserStencilSettings) {
return CanDrawPath::kNo;
}
- if (GrAAType::kCoverage == args.fAAType) {
- SkASSERT(1 == args.fProxy->numSamples());
- if (!args.fProxy->canUseMixedSamples(*args.fCaps)) {
- return CanDrawPath::kNo;
- }
- }
// On platforms that don't have native support for indirect draws and/or hardware tessellation,
// we find that cached triangulations of strokes can render slightly faster. Let cacheable paths
// go to the triangulator on these platforms for now.
@@ -424,30 +419,16 @@
auto aaType = GrAAType::kMSAA;
auto fillRectFlags = GrFillRectOp::InputFlags::kNone;
- // This will be the final op in the surfaceDrawContext. So if Ganesh is planning to discard the
- // stencil values anyway, then we might not actually need to reset the stencil values back to 0.
- bool mustResetStencil = !onFlushRP->caps()->discardStencilValuesAfterRenderPass();
-
- if (rtc->numSamples() == 1) {
- // We are mixed sampled. We need to either enable conservative raster (preferred) or disable
- // MSAA in order to avoid double blend artifacts. (Even if we disable MSAA for the cover
- // geometry, the stencil test is still multisampled and will still produce smooth results.)
- if (onFlushRP->caps()->conservativeRasterSupport()) {
- fillRectFlags |= GrFillRectOp::InputFlags::kConservativeRaster;
- } else {
- aaType = GrAAType::kNone;
- }
- mustResetStencil = true;
- }
-
SkRect coverRect = SkRect::MakeIWH(fAtlas.drawBounds().width(), fAtlas.drawBounds().height());
const GrUserStencilSettings* stencil;
- if (mustResetStencil) {
+ if (onFlushRP->caps()->discardStencilValuesAfterRenderPass()) {
+ // This is the final op in the surfaceDrawContext. Since Ganesh is planning to discard the
+ // stencil values anyway, there is no need to reset the stencil values back to 0.
+ stencil = &kTestStencil;
+ } else {
// Outset the cover rect in case there are T-junctions in the path bounds.
coverRect.outset(1, 1);
stencil = &kTestAndResetStencil;
- } else {
- stencil = &kTestStencil;
}
GrQuad coverQuad(coverRect);
diff --git a/src/gpu/tessellate/GrTessellationPathRenderer.h b/src/gpu/tessellate/GrTessellationPathRenderer.h
index fd4fe0e..4629e75 100644
--- a/src/gpu/tessellate/GrTessellationPathRenderer.h
+++ b/src/gpu/tessellate/GrTessellationPathRenderer.h
@@ -15,8 +15,8 @@
// This is the tie-in point for path rendering via GrPathTessellateOp. This path renderer draws
// paths using a hybrid Red Book "stencil, then cover" method. Curves get linearized by GPU
-// tessellation shaders. This path renderer doesn't apply analytic AA, so it requires a render
-// target that supports either MSAA or mixed samples if AA is desired.
+// tessellation shaders. This path renderer doesn't apply analytic AA, so it requires MSAA if AA is
+// desired.
class GrTessellationPathRenderer : public GrPathRenderer, public GrOnFlushCallbackObject {
public:
// Don't allow linearized segments to be off by more than 1/4th of a pixel from the true curve.
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 661be65..52efa3e 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -556,15 +556,6 @@
// GrCaps workarounds
////////////////////////////////////////////////////////////////////////////
- // The GTX660 bot was experiencing crashes and incorrect rendering with MSAA CCPR. Block this
- // path renderer on non-mixed-sampled NVIDIA.
- // NOTE: We may lose mixed samples support later if the context options suppress dual source
- // blending, but that shouldn't be an issue because MSAA CCPR seems to work fine (even without
- // mixed samples) on later NVIDIA hardware where mixed samples would be supported.
- if ((kNvidia_VkVendor == properties.vendorID) && !fMixedSamplesSupport) {
- fDriverDisableMSAAClipAtlas = true;
- }
-
#ifdef SK_BUILD_FOR_ANDROID
// MSAA CCPR was slow on Android. http://skbug.com/9676
fDriverDisableMSAAClipAtlas = true;
@@ -628,10 +619,6 @@
}
#endif
- if (extensions.hasExtension(VK_NV_FRAMEBUFFER_MIXED_SAMPLES_EXTENSION_NAME, 1)) {
- fMixedSamplesSupport = true;
- }
-
if (extensions.hasExtension(VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME, 1)) {
fConservativeRasterSupport = true;
}
@@ -1840,7 +1827,7 @@
SkASSERT(!needsResolve || (vkRT->resolveAttachment() &&
vkRT->resolveAttachment()->supportsInputAttachmentUsage()));
- bool needsStencil = programInfo.numStencilSamples() || programInfo.isStencilEnabled();
+ bool needsStencil = programInfo.needsStencil() || programInfo.isStencilEnabled();
// TODO: support failure in getSimpleRenderPass
auto rp = vkRT->getSimpleRenderPass(needsResolve, needsStencil, selfDepFlags,
loadFromResolve);
@@ -1878,17 +1865,11 @@
stencil.genKey(&b, true);
programInfo.pipeline().genKey(&b, *this);
- b.add32(programInfo.numRasterSamples());
+ b.add32(programInfo.numSamples());
// Vulkan requires the full primitive type as part of its key
b.add32(programInfo.primitiveTypeKey());
- if (this->mixedSamplesSupport()) {
- // Add "0" to indicate that coverage modulation will not be enabled, or the (non-zero)
- // raster sample count if it will.
- b.add32(!programInfo.isMixedSampled() ? 0 : programInfo.numRasterSamples());
- }
-
b.flush();
return desc;
}
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index f03c892..7bbc86a 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -1469,16 +1469,14 @@
////////////////////////////////////////////////////////////////////////////////
sk_sp<GrAttachment> GrVkGpu::makeStencilAttachmentForRenderTarget(const GrRenderTarget* rt,
- SkISize dimensions,
- int numStencilSamples) {
- SkASSERT(numStencilSamples == rt->numSamples() || this->caps()->mixedSamplesSupport());
+ SkISize dimensions) {
SkASSERT(dimensions.width() >= rt->width());
SkASSERT(dimensions.height() >= rt->height());
VkFormat sFmt = this->vkCaps().preferredStencilFormat();
fStats.incStencilAttachmentCreates();
- return GrVkAttachment::MakeStencil(this, dimensions, numStencilSamples, sFmt);
+ return GrVkAttachment::MakeStencil(this, dimensions, rt->numSamples(), sFmt);
}
sk_sp<GrAttachment> GrVkGpu::makeMSAAAttachment(SkISize dimensions,
diff --git a/src/gpu/vk/GrVkGpu.h b/src/gpu/vk/GrVkGpu.h
index e9d5e50..de78772 100644
--- a/src/gpu/vk/GrVkGpu.h
+++ b/src/gpu/vk/GrVkGpu.h
@@ -109,8 +109,7 @@
#endif
sk_sp<GrAttachment> makeStencilAttachmentForRenderTarget(const GrRenderTarget*,
- SkISize dimensions,
- int numStencilSamples) override;
+ SkISize dimensions) override;
GrBackendFormat getPreferredStencilFormat(const GrBackendFormat&) override {
return GrBackendFormat::MakeVk(this->vkCaps().preferredStencilFormat());
diff --git a/src/gpu/vk/GrVkPipeline.cpp b/src/gpu/vk/GrVkPipeline.cpp
index 377a837..a9d9424 100644
--- a/src/gpu/vk/GrVkPipeline.cpp
+++ b/src/gpu/vk/GrVkPipeline.cpp
@@ -279,14 +279,14 @@
SkASSERT(viewportInfo->viewportCount == viewportInfo->scissorCount);
}
-static void setup_multisample_state(int numRasterSamples,
+static void setup_multisample_state(int numSamples,
const GrCaps* caps,
VkPipelineMultisampleStateCreateInfo* multisampleInfo) {
memset(multisampleInfo, 0, sizeof(VkPipelineMultisampleStateCreateInfo));
multisampleInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
multisampleInfo->pNext = nullptr;
multisampleInfo->flags = 0;
- SkAssertResult(GrSampleCountToVkSampleCount(numRasterSamples,
+ SkAssertResult(GrSampleCountToVkSampleCount(numSamples,
&multisampleInfo->rasterizationSamples));
multisampleInfo->sampleShadingEnable = VK_FALSE;
multisampleInfo->minSampleShading = 0.0f;
@@ -296,7 +296,7 @@
}
static void setup_all_sample_locations_at_pixel_center(
- int numRasterSamples,
+ int numSamples,
VkPipelineSampleLocationsStateCreateInfoEXT* sampleLocations) {
constexpr static VkSampleLocationEXT kCenteredSampleLocations[16] = {
{.5f,.5f}, {.5f,.5f}, {.5f,.5f}, {.5f,.5f}, {.5f,.5f}, {.5f,.5f}, {.5f,.5f}, {.5f,.5f},
@@ -308,29 +308,16 @@
sampleLocations->sampleLocationsInfo.sType = VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT;
sampleLocations->sampleLocationsInfo.pNext = nullptr;
SkAssertResult(GrSampleCountToVkSampleCount(
- numRasterSamples,
+ numSamples,
&sampleLocations->sampleLocationsInfo.sampleLocationsPerPixel));
sampleLocations->sampleLocationsInfo.sampleLocationGridSize.width = 1;
sampleLocations->sampleLocationsInfo.sampleLocationGridSize.height = 1;
- SkASSERT(numRasterSamples < (int)SK_ARRAY_COUNT(kCenteredSampleLocations));
+ SkASSERT(numSamples < (int)SK_ARRAY_COUNT(kCenteredSampleLocations));
sampleLocations->sampleLocationsInfo.sampleLocationsCount = std::min(
- numRasterSamples, (int)SK_ARRAY_COUNT(kCenteredSampleLocations));
+ numSamples, (int)SK_ARRAY_COUNT(kCenteredSampleLocations));
sampleLocations->sampleLocationsInfo.pSampleLocations = kCenteredSampleLocations;
}
-static void setup_coverage_modulation_state(
- VkPipelineCoverageModulationStateCreateInfoNV* coverageModulationInfo) {
- memset(coverageModulationInfo, 0, sizeof(VkPipelineCoverageModulationStateCreateInfoNV));
- coverageModulationInfo->sType =
- VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV;
- coverageModulationInfo->pNext = nullptr;
- coverageModulationInfo->flags = 0;
- coverageModulationInfo->coverageModulationMode = VK_COVERAGE_MODULATION_MODE_RGBA_NV;
- coverageModulationInfo->coverageModulationTableEnable = false;
- coverageModulationInfo->coverageModulationTableCount = 0;
- coverageModulationInfo->pCoverageModulationTable = nullptr;
-}
-
static VkBlendFactor blend_coeff_to_vk_blend(GrBlendCoeff coeff) {
switch (coeff) {
case kZero_GrBlendCoeff:
@@ -510,9 +497,8 @@
GrPrimitiveType primitiveType,
GrSurfaceOrigin origin,
const GrStencilSettings& stencilSettings,
- int numRasterSamples,
+ int numSamples,
bool isHWAntialiasState,
- bool isMixedSampled,
const GrXferProcessor::BlendInfo& blendInfo,
bool isWireframe,
bool useConservativeRaster,
@@ -542,27 +528,17 @@
setup_viewport_scissor_state(&viewportInfo);
VkPipelineMultisampleStateCreateInfo multisampleInfo;
- setup_multisample_state(numRasterSamples, gpu->caps(), &multisampleInfo);
+ setup_multisample_state(numSamples, gpu->caps(), &multisampleInfo);
VkPipelineSampleLocationsStateCreateInfoEXT sampleLocations;
if (gpu->caps()->multisampleDisableSupport()) {
- if (numRasterSamples > 1 && !isHWAntialiasState) {
- setup_all_sample_locations_at_pixel_center(numRasterSamples, &sampleLocations);
+ if (numSamples > 1 && !isHWAntialiasState) {
+ setup_all_sample_locations_at_pixel_center(numSamples, &sampleLocations);
sampleLocations.pNext = multisampleInfo.pNext;
multisampleInfo.pNext = &sampleLocations;
}
}
- VkPipelineCoverageModulationStateCreateInfoNV coverageModulationInfo;
- if (gpu->caps()->mixedSamplesSupport()) {
- if (isMixedSampled) {
- SkASSERT(gpu->caps()->mixedSamplesSupport());
- setup_coverage_modulation_state(&coverageModulationInfo);
- coverageModulationInfo.pNext = multisampleInfo.pNext;
- multisampleInfo.pNext = &coverageModulationInfo;
- }
- }
-
// We will only have one color attachment per pipeline.
VkPipelineColorBlendAttachmentState attachmentStates[1];
VkPipelineColorBlendStateCreateInfo colorBlendInfo;
@@ -645,9 +621,8 @@
programInfo.primitiveType(),
programInfo.origin(),
programInfo.nonGLStencilSettings(),
- programInfo.numRasterSamples(),
+ programInfo.numSamples(),
pipeline.isHWAntialiasState(),
- programInfo.isMixedSampled(),
pipeline.getXferProcessor().getBlendInfo(),
pipeline.isWireframe(),
pipeline.usesConservativeRaster(),
diff --git a/src/gpu/vk/GrVkPipeline.h b/src/gpu/vk/GrVkPipeline.h
index 6e4261e..f8891b8 100644
--- a/src/gpu/vk/GrVkPipeline.h
+++ b/src/gpu/vk/GrVkPipeline.h
@@ -32,9 +32,8 @@
GrPrimitiveType,
GrSurfaceOrigin,
const GrStencilSettings&,
- int numRasterSamples,
+ int numSamples,
bool isHWAntialiasState,
- bool isMixedSampled,
const GrXferProcessor::BlendInfo&,
bool isWireframe,
bool useConservativeRaster,
diff --git a/src/gpu/vk/GrVkPipelineStateCache.cpp b/src/gpu/vk/GrVkPipelineStateCache.cpp
index c4e6641..0b7efc7 100644
--- a/src/gpu/vk/GrVkPipelineStateCache.cpp
+++ b/src/gpu/vk/GrVkPipelineStateCache.cpp
@@ -79,8 +79,7 @@
if (programInfo.isStencilEnabled()) {
SkASSERT(renderTarget->getStencilAttachment());
SkASSERT(renderTarget->numStencilBits() == 8);
- SkASSERT(renderTarget->getStencilAttachment()->numSamples() ==
- programInfo.numStencilSamples());
+ SkASSERT(renderTarget->getStencilAttachment()->numSamples() == programInfo.numSamples());
}
#endif
diff --git a/src/gpu/vk/GrVkRenderTarget.cpp b/src/gpu/vk/GrVkRenderTarget.cpp
index f7efbf7..1e6a424 100644
--- a/src/gpu/vk/GrVkRenderTarget.cpp
+++ b/src/gpu/vk/GrVkRenderTarget.cpp
@@ -359,13 +359,7 @@
const GrVkAttachment* vkStencil = static_cast<const GrVkAttachment*>(stencil);
desc->fStencil.fFormat = vkStencil->imageFormat();
desc->fStencil.fSamples = vkStencil->numSamples();
-#ifdef SK_DEBUG
- if (this->getVkGpu()->caps()->mixedSamplesSupport()) {
- SkASSERT(desc->fStencil.fSamples >= desc->fColor.fSamples);
- } else {
- SkASSERT(desc->fStencil.fSamples == desc->fColor.fSamples);
- }
-#endif
+ SkASSERT(desc->fStencil.fSamples == desc->fColor.fSamples);
*attachmentFlags |= GrVkRenderPass::kStencil_AttachmentFlag;
++attachmentCount;
}
@@ -391,18 +385,12 @@
++attachmentCount;
}
- SkASSERT(!programInfo.isStencilEnabled() || programInfo.numStencilSamples());
- if (programInfo.numStencilSamples()) {
+ SkASSERT(!programInfo.isStencilEnabled() || programInfo.needsStencil());
+ if (programInfo.needsStencil()) {
VkFormat stencilFormat = vkCaps.preferredStencilFormat();
desc->fStencil.fFormat = stencilFormat;
- desc->fStencil.fSamples = programInfo.numStencilSamples();
-#ifdef SK_DEBUG
- if (vkCaps.mixedSamplesSupport()) {
- SkASSERT(desc->fStencil.fSamples >= desc->fColor.fSamples);
- } else {
- SkASSERT(desc->fStencil.fSamples == desc->fColor.fSamples);
- }
-#endif
+ desc->fStencil.fSamples = programInfo.numSamples();
+ SkASSERT(desc->fStencil.fSamples == desc->fColor.fSamples);
*flags |= GrVkRenderPass::kStencil_AttachmentFlag;
++attachmentCount;
}
diff --git a/src/gpu/vk/GrVkResourceProvider.cpp b/src/gpu/vk/GrVkResourceProvider.cpp
index 25397e2..1d6c381 100644
--- a/src/gpu/vk/GrVkResourceProvider.cpp
+++ b/src/gpu/vk/GrVkResourceProvider.cpp
@@ -300,7 +300,6 @@
GrStencilSettings(),
dst->numSamples(),
/*isHWantialiasState=*/false,
- /*isMixedSampled=*/false,
GrXferProcessor::BlendInfo(),
/*isWireframe=*/false,
/*useConservativeRaster=*/false,
diff --git a/tests/AdvancedBlendTest.cpp b/tests/AdvancedBlendTest.cpp
index 1b2e3c9..e9006d1 100644
--- a/tests/AdvancedBlendTest.cpp
+++ b/tests/AdvancedBlendTest.cpp
@@ -35,17 +35,15 @@
const GrXPFactory* xpf = GrCustomXfermode::Get(blendMode);
GrXPFactory::AnalysisProperties xpfAnalysis =
- GrXPFactory::GetAnalysisProperties(xpf, opaque, coverage, false, caps,
- GrClampType::kAuto);
+ GrXPFactory::GetAnalysisProperties(xpf, opaque, coverage, caps, GrClampType::kAuto);
GrPaint paint;
paint.setXPFactory(xpf);
GrProcessorSet procs(std::move(paint));
- bool hasMixedSampledCoverage = false;
SkPMColor4f overrideColor;
GrProcessorSet::Analysis processorAnalysis = procs.finalize(
- opaque, coverage, nullptr, &GrUserStencilSettings::kUnused, hasMixedSampledCoverage,
- caps, GrClampType::kAuto, &overrideColor);
+ opaque, coverage, nullptr, &GrUserStencilSettings::kUnused, caps,
+ GrClampType::kAuto, &overrideColor);
if (caps.advancedBlendEquationSupport() &&
!caps.isAdvancedBlendEquationDisabled(blendEquation)) {
diff --git a/tests/DrawOpAtlasTest.cpp b/tests/DrawOpAtlasTest.cpp
index 3c6db5a..e5fab3c 100644
--- a/tests/DrawOpAtlasTest.cpp
+++ b/tests/DrawOpAtlasTest.cpp
@@ -215,10 +215,8 @@
return;
}
- bool hasMixedSampledCoverage = false;
GrAtlasTextOp* atlasTextOp = (GrAtlasTextOp*)op.get();
- atlasTextOp->finalize(
- *context->priv().caps(), nullptr, hasMixedSampledCoverage, GrClampType::kAuto);
+ atlasTextOp->finalize(*context->priv().caps(), nullptr, GrClampType::kAuto);
TestingUploadTarget uploadTarget;
diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp
index ef703ca..40a9ccd 100644
--- a/tests/GrMeshTest.cpp
+++ b/tests/GrMeshTest.cpp
@@ -417,8 +417,7 @@
const char* name() const override { return "GrMeshTestOp"; }
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override {
return GrProcessorSet::EmptySetAnalysis();
}
@@ -558,7 +557,6 @@
GrProcessorAnalysisCoverage::kNone,
fState->appliedClip(),
nullptr,
- false,
fState->caps(),
GrClampType::kAuto,
&overrideColor);
diff --git a/tests/GrPipelineDynamicStateTest.cpp b/tests/GrPipelineDynamicStateTest.cpp
index d8e9868..e778a62 100644
--- a/tests/GrPipelineDynamicStateTest.cpp
+++ b/tests/GrPipelineDynamicStateTest.cpp
@@ -139,8 +139,7 @@
const char* name() const override { return "GrPipelineDynamicStateTestOp"; }
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override {
return GrProcessorSet::EmptySetAnalysis();
}
void onPrePrepare(GrRecordingContext*,
diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp
index d82339d..51b5342 100644
--- a/tests/GrPorterDuffTest.cpp
+++ b/tests/GrPorterDuffTest.cpp
@@ -68,11 +68,10 @@
GrPaint paint;
paint.setXPFactory(xpf);
GrProcessorSet procs(std::move(paint));
- bool hasMixedSampledCoverage = false;
SkPMColor4f overrideColor;
GrProcessorSet::Analysis analysis = procs.finalize(
- colorInput, coverageInput, nullptr, &GrUserStencilSettings::kUnused,
- hasMixedSampledCoverage, caps, GrClampType::kAuto, &overrideColor);
+ colorInput, coverageInput, nullptr, &GrUserStencilSettings::kUnused, caps,
+ GrClampType::kAuto, &overrideColor);
return analysis;
}
@@ -90,7 +89,7 @@
fUnaffectedByDstValue = analysis.unaffectedByDstValue();
fIgnoresInputColor = analysis.inputColorIsIgnored();
sk_sp<const GrXferProcessor> xp(
- GrXPFactory::MakeXferProcessor(xpf, inputColor, inputCoverage, false, caps,
+ GrXPFactory::MakeXferProcessor(xpf, inputColor, inputCoverage, caps,
GrClampType::kAuto));
TEST_ASSERT(!analysis.requiresDstTexture() ||
(isLCD &&
@@ -1032,10 +1031,10 @@
const GrXPFactory* xpf = GrPorterDuffXPFactory::Get(SkBlendMode::kSrcOver);
GrProcessorAnalysisColor color = SkPMColor4f::FromBytes_RGBA(GrColorPackRGBA(123, 45, 67, 255));
GrProcessorAnalysisCoverage coverage = GrProcessorAnalysisCoverage::kLCD;
- TEST_ASSERT(!(GrXPFactory::GetAnalysisProperties(xpf, color, coverage, false, caps, autoClamp) &
+ TEST_ASSERT(!(GrXPFactory::GetAnalysisProperties(xpf, color, coverage, caps, autoClamp) &
GrXPFactory::AnalysisProperties::kRequiresDstTexture));
sk_sp<const GrXferProcessor> xp_opaque(
- GrXPFactory::MakeXferProcessor(xpf, color, coverage, false, caps, autoClamp));
+ GrXPFactory::MakeXferProcessor(xpf, color, coverage, caps, autoClamp));
if (!xp_opaque) {
ERRORF(reporter, "Failed to create an XP with LCD coverage.");
return;
@@ -1047,10 +1046,10 @@
// Test with non-opaque alpha
color = SkPMColor4f::FromBytes_RGBA(GrColorPackRGBA(123, 45, 67, 221));
coverage = GrProcessorAnalysisCoverage::kLCD;
- TEST_ASSERT(!(GrXPFactory::GetAnalysisProperties(xpf, color, coverage, false, caps, autoClamp) &
+ TEST_ASSERT(!(GrXPFactory::GetAnalysisProperties(xpf, color, coverage, caps, autoClamp) &
GrXPFactory::AnalysisProperties::kRequiresDstTexture));
sk_sp<const GrXferProcessor> xp(
- GrXPFactory::MakeXferProcessor(xpf, color, coverage, false, caps, autoClamp));
+ GrXPFactory::MakeXferProcessor(xpf, color, coverage, caps, autoClamp));
if (!xp) {
ERRORF(reporter, "Failed to create an XP with LCD coverage.");
return;
@@ -1103,7 +1102,7 @@
SkBlendMode xfermode = static_cast<SkBlendMode>(m);
const GrXPFactory* xpf = GrPorterDuffXPFactory::Get(xfermode);
sk_sp<const GrXferProcessor> xp(
- GrXPFactory::MakeXferProcessor(xpf, colorInput, coverageType, false, caps,
+ GrXPFactory::MakeXferProcessor(xpf, colorInput, coverageType, caps,
GrClampType::kAuto));
if (!xp) {
ERRORF(reporter, "Failed to create an XP without dual source blending.");
diff --git a/tests/GrThreadSafeCacheTest.cpp b/tests/GrThreadSafeCacheTest.cpp
index ad594ef..82eb142 100644
--- a/tests/GrThreadSafeCacheTest.cpp
+++ b/tests/GrThreadSafeCacheTest.cpp
@@ -447,8 +447,7 @@
const char* name() const override { return "GrThreadSafeVertexTestOp"; }
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override {
return GrProcessorSet::EmptySetAnalysis();
}
diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp
index 77ee1f5..3282fb6 100644
--- a/tests/LazyProxyTest.cpp
+++ b/tests/LazyProxyTest.cpp
@@ -105,7 +105,7 @@
const char* name() const override { return "LazyProxyTest::Op"; }
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip* clip,
- bool hasMixedSampledCoverage, GrClampType) override {
+ GrClampType) override {
return GrProcessorSet::EmptySetAnalysis();
}
void onPrePrepare(GrRecordingContext*,
@@ -355,8 +355,7 @@
const char* name() const override { return "LazyFailedInstantiationTestOp"; }
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override {
return GrProcessorSet::EmptySetAnalysis();
}
void onPrePrepare(GrRecordingContext*,
diff --git a/tests/OnFlushCallbackTest.cpp b/tests/OnFlushCallbackTest.cpp
index e77baeb..7c4aba5 100644
--- a/tests/OnFlushCallbackTest.cpp
+++ b/tests/OnFlushCallbackTest.cpp
@@ -79,14 +79,13 @@
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip*, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ const GrCaps& caps, const GrAppliedClip*, GrClampType clampType) override {
// Set the color to unknown because the subclass may change the color later.
GrProcessorAnalysisColor gpColor;
gpColor.setToUnknown();
// We ignore the clip so pass this rather than the GrAppliedClip param.
static GrAppliedClip kNoClip = GrAppliedClip::Disabled();
- return fHelper.finalizeProcessors(caps, &kNoClip, hasMixedSampledCoverage, clampType,
+ return fHelper.finalizeProcessors(caps, &kNoClip, clampType,
GrProcessorAnalysisCoverage::kNone, &gpColor);
}
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp
index f73d1dc..27ef7fc 100644
--- a/tests/PrimitiveProcessorTest.cpp
+++ b/tests/PrimitiveProcessorTest.cpp
@@ -43,8 +43,7 @@
return FixedFunctionFlags::kNone;
}
- GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
- bool hasMixedSampledCoverage, GrClampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) override {
return GrProcessorSet::EmptySetAnalysis();
}
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index 3caf1f3..52d8c88 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -43,15 +43,13 @@
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- GrProcessorSet::Analysis finalize(
- const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage,
- GrClampType clampType) override {
+ GrProcessorSet::Analysis finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrClampType clampType) override {
static constexpr GrProcessorAnalysisColor kUnknownColor;
SkPMColor4f overrideColor;
return fProcessors.finalize(
kUnknownColor, GrProcessorAnalysisCoverage::kNone, clip,
- &GrUserStencilSettings::kUnused, hasMixedSampledCoverage, caps, clampType,
- &overrideColor);
+ &GrUserStencilSettings::kUnused, caps, clampType, &overrideColor);
}
private:
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index b7c4913..65cbaeb 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -96,7 +96,7 @@
return nullptr;
}
- if (!provider->attachStencilAttachment(tex->asRenderTarget(), sampleCount)) {
+ if (!provider->attachStencilAttachment(tex->asRenderTarget())) {
return nullptr;
}
SkASSERT(get_SB(tex->asRenderTarget()));
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index c338182..6f8273f 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -1007,7 +1007,7 @@
// our surface functions.
auto sdc = SkCanvasPriv::TopDeviceSurfaceDrawContext(surface->getCanvas());
GrRenderTarget* rt = sdc->accessRenderTarget();
- REPORTER_ASSERT(reporter, resourceProvider->attachStencilAttachment(rt, sampleCnt));
+ REPORTER_ASSERT(reporter, resourceProvider->attachStencilAttachment(rt));
}
}
}
diff --git a/tools/flags/CommonFlagsGpu.cpp b/tools/flags/CommonFlagsGpu.cpp
index 096a807..e1fc75d 100644
--- a/tools/flags/CommonFlagsGpu.cpp
+++ b/tools/flags/CommonFlagsGpu.cpp
@@ -30,8 +30,7 @@
"[~]none [~]dashline [~]ccpr [~]aahairline [~]aaconvex [~]aalinearizing "
"[~]small [~]tri [~]tess [~]all");
-static DEFINE_int(internalSamples, 4,
- "Number of samples for internal draws that use MSAA or mixed samples.");
+static DEFINE_int(internalSamples, 4, "Number of samples for internal draws that use MSAA.");
static DEFINE_bool(disableDriverCorrectnessWorkarounds, false,
"Disables all GPU driver correctness workarounds");
diff --git a/tools/gpu/ProxyUtils.cpp b/tools/gpu/ProxyUtils.cpp
index f3344e6..756eaa1 100644
--- a/tools/gpu/ProxyUtils.cpp
+++ b/tools/gpu/ProxyUtils.cpp
@@ -107,8 +107,8 @@
SkDEBUGCODE(auto analysis =) processors.finalize(analysisColor,
GrProcessorAnalysisCoverage::kSingleChannel,
- &appliedClip, stencilSettings, false,
- *caps, GrClampType::kAuto, &analysisColor);
+ &appliedClip, stencilSettings, *caps,
+ GrClampType::kAuto, &analysisColor);
SkASSERT(!analysis.requiresDstTexture());
return GrSimpleMeshDrawOpHelper::CreateProgramInfo(caps, arena, writeView,
diff --git a/tools/gpu/TestOps.cpp b/tools/gpu/TestOps.cpp
index e4136ba..9e74d0d 100644
--- a/tools/gpu/TestOps.cpp
+++ b/tools/gpu/TestOps.cpp
@@ -101,7 +101,6 @@
GrProcessorSet::Analysis finalize(const GrCaps&,
const GrAppliedClip*,
- bool hasMixedSampledCoverage,
GrClampType) override;
void visitProxies(const VisitProxyFunc& func) const override {
@@ -158,12 +157,10 @@
GrProcessorSet::Analysis TestRectOp::finalize(const GrCaps& caps,
const GrAppliedClip* clip,
- bool hasMixedSampledCoverage,
GrClampType clampType) {
return fProcessorSet.finalize(GrProcessorAnalysisColor::Opaque::kYes,
GrProcessorAnalysisCoverage::kSingleChannel, clip,
- &GrUserStencilSettings::kUnused, hasMixedSampledCoverage, caps,
- clampType, &fColor);
+ &GrUserStencilSettings::kUnused, caps, clampType, &fColor);
}
static bool use_wide_color(const GrPaint& paint, const GrCaps* caps) {
diff --git a/tools/skpbench/skpbench.py b/tools/skpbench/skpbench.py
index c3b16b9..68e4b06 100755
--- a/tools/skpbench/skpbench.py
+++ b/tools/skpbench/skpbench.py
@@ -91,7 +91,7 @@
" software path rendering. Defaults to two.")
__argparse.add_argument('--internalSamples',
type=int, default=-1,
- help="Number of samples for internal draws that use MSAA or mixed samples.")
+ help="Number of samples for internal draws that use MSAA.")
__argparse.add_argument('srcs',
nargs='+',
help=".skp files or directories to expand for .skp files, and/or .svg files")
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index 7c37b0c..c30615c 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -1927,7 +1927,7 @@
} else {
const auto* caps = ctx->priv().caps();
prButton(GpuPathRenderers::kDefault);
- if (fWindow->sampleCount() > 1 || caps->mixedSamplesSupport()) {
+ if (fWindow->sampleCount() > 1 || FLAGS_dmsaa) {
if (GrTessellationPathRenderer::IsSupported(*caps)) {
prButton(GpuPathRenderers::kTessellation);
}
@@ -2760,7 +2760,7 @@
} else {
const auto* caps = ctx->priv().caps();
writer.appendString(gPathRendererNames[GpuPathRenderers::kDefault].c_str());
- if (fWindow->sampleCount() > 1 || caps->mixedSamplesSupport()) {
+ if (fWindow->sampleCount() > 1 || FLAGS_dmsaa) {
if (GrTessellationPathRenderer::IsSupported(*caps)) {
writer.appendString(
gPathRendererNames[GpuPathRenderers::kTessellation].c_str());