aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/ops/GrSimpleMeshDrawOpHelper.h')
-rw-r--r--src/gpu/ops/GrSimpleMeshDrawOpHelper.h25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/gpu/ops/GrSimpleMeshDrawOpHelper.h b/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
index c230257c1c..dcd8dd887e 100644
--- a/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
+++ b/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
@@ -41,7 +41,8 @@ public:
, fPipelineFlags(args.fSRGBFlags)
, fAAType((int)aaType)
, fRequiresDstTexture(false)
- , fUsesLocalCoords(false) {
+ , fUsesLocalCoords(false)
+ , fCompatibleWithAlphaAsCoveage(false) {
SkASSERT(!stencilSettings);
SkDEBUGCODE(fDidAnalysis = false);
if (GrAATypeIsHW(aaType)) {
@@ -80,12 +81,16 @@ public:
}
}
}
- return fPipelineFlags == that.fPipelineFlags && fAAType == that.fAAType;
+ bool result = fPipelineFlags == that.fPipelineFlags && fAAType == that.fAAType;
+ SkASSERT(!result || fCompatibleWithAlphaAsCoveage == that.fCompatibleWithAlphaAsCoveage);
+ SkASSERT(!result || fUsesLocalCoords == that.fUsesLocalCoords);
+ return result;
}
bool xpRequiresDstTexture(const GrCaps& caps, const GrAppliedClip* clip,
GrProcessorAnalysisCoverage geometryCoverage, GrColor* color) {
SkDEBUGCODE(fDidAnalysis = true);
+ GrProcessorSet::Analysis analysis;
if (fProcessors) {
GrProcessorAnalysisCoverage coverage = geometryCoverage;
if (GrProcessorAnalysisCoverage::kNone == coverage) {
@@ -94,15 +99,14 @@ public:
: GrProcessorAnalysisCoverage::kNone;
}
bool isMixedSamples = this->aaType() == GrAAType::kMixedSamples;
- GrProcessorSet::Analysis analysis =
- fProcessors->finalize(*color, coverage, clip, isMixedSamples, caps, color);
- fRequiresDstTexture = analysis.requiresDstTexture();
- fUsesLocalCoords = analysis.usesLocalCoords();
- return analysis.requiresDstTexture();
+ analysis = fProcessors->finalize(*color, coverage, clip, isMixedSamples, caps, color);
} else {
- fUsesLocalCoords = GrProcessorSet::EmptySetAnalysis().usesLocalCoords();
- return GrProcessorSet::EmptySetAnalysis().requiresDstTexture();
+ analysis = GrProcessorSet::EmptySetAnalysis();
}
+ fRequiresDstTexture = analysis.requiresDstTexture();
+ fUsesLocalCoords = analysis.usesLocalCoords();
+ fCompatibleWithAlphaAsCoveage = analysis.isCompatibleWithCoverageAsAlpha();
+ return analysis.requiresDstTexture();
}
bool usesLocalCoords() const {
@@ -110,6 +114,8 @@ public:
return fUsesLocalCoords;
}
+ bool compatibleWithAlphaAsCoverage() const { return fCompatibleWithAlphaAsCoveage; }
+
GrPipeline* makePipeline(GrMeshDrawOp::Target* target) const {
return target->allocPipeline(this->pipelineInitArgs(target));
}
@@ -149,6 +155,7 @@ private:
unsigned fAAType : 2;
unsigned fRequiresDstTexture : 1;
unsigned fUsesLocalCoords : 1;
+ unsigned fCompatibleWithAlphaAsCoveage : 1;
SkDEBUGCODE(unsigned fDidAnalysis : 1;)
};