Split GrPipelineInput into separate color and coverage types, the latter of which is just an enum.
Assign names that indicate that they aren't just for the input phase since I plan to use them at the boundary between FPs and XPs as well.
Renamed GrProcOptInfo to GrColorFragmentProcessorAnalysis. This is now only used on the color side and the new name seems clearer to me.
Change GrMeshDrawOp::getFragmentProcessorAnalysisInputs to use the new color/coverage types directly rather than a class that has been reduced to simply bundling them together.
Change-Id: If93bae74c9d590486eecdf63f302418c96deab65
Reviewed-on: https://skia-review.googlesource.com/10161
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index 37e4c16..1f2771c 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -52,12 +52,12 @@
#undef EQ_OFFSET
}
-static bool can_use_hw_blend_equation(GrBlendEquation equation, bool isLCDCoverage,
+static bool can_use_hw_blend_equation(GrBlendEquation equation, GrPipelineAnalysisCoverage coverage,
const GrCaps& caps) {
if (!caps.advancedBlendEquationSupport()) {
return false;
}
- if (isLCDCoverage) {
+ if (GrPipelineAnalysisCoverage::kLCD == coverage) {
return false; // LCD coverage must be applied after the blend equation.
}
if (caps.canUseAdvancedBlendEquation(equation)) {
@@ -347,7 +347,7 @@
bool hasMixedSamples,
const DstTexture* dstTexture) const {
SkASSERT(GrCustomXfermode::IsSupportedMode(fMode));
- if (can_use_hw_blend_equation(fHWBlendEquation, analysis.hasLCDCoverage(), caps)) {
+ if (can_use_hw_blend_equation(fHWBlendEquation, analysis.outputCoverageType(), caps)) {
SkASSERT(!dstTexture || !dstTexture->texture());
return new CustomXP(fMode, fHWBlendEquation);
}
@@ -356,7 +356,7 @@
bool CustomXPFactory::willReadDstInShader(const GrCaps& caps,
const FragmentProcessorAnalysis& analysis) const {
- return !can_use_hw_blend_equation(fHWBlendEquation, analysis.hasLCDCoverage(), caps);
+ return !can_use_hw_blend_equation(fHWBlendEquation, analysis.outputCoverageType(), caps);
}
GR_DEFINE_XP_FACTORY_TEST(CustomXPFactory);