Index: src/gpu/effects/GrCoverageSetOpXP.cpp |
diff --git a/src/gpu/effects/GrCoverageSetOpXP.cpp b/src/gpu/effects/GrCoverageSetOpXP.cpp |
index cddbbfb49e7f1665ba54b7e3c2069006db69f545..d956cd31b08d6d5c1fbc701c000f31e0c23ac993 100644 |
--- a/src/gpu/effects/GrCoverageSetOpXP.cpp |
+++ b/src/gpu/effects/GrCoverageSetOpXP.cpp |
@@ -186,40 +186,27 @@ GrXferProcessor* GrCoverageSetOpXPFactory::createXferProcessor(const GrProcOptIn |
return GrCoverageSetOpXP::Create(fRegionOp, fInvertCoverage); |
} |
-bool GrCoverageSetOpXPFactory::willBlendWithDst(const GrProcOptInfo& colorPOI, |
- const GrProcOptInfo& coveragePOI, |
- bool colorWriteDisabled) const { |
- // TODO: once all SkXferEffects are XP's then we will never reads dst here since only XP's |
- // will readDst and this XP doesn't read dst. |
- if (coveragePOI.readsDst()) { |
- return true; |
- } |
- |
- // Besides Replace all other SkRegion ops will either have a src coeff that references dst or a |
- // non zero dst coeff |
- return SkRegion::kReplace_Op != fRegionOp; |
-} |
- |
-bool GrCoverageSetOpXPFactory::getOpaqueAndKnownColor(const GrProcOptInfo& colorPOI, |
- const GrProcOptInfo& coveragePOI, |
- GrColor* solidColor, |
- uint32_t* solidColorKnownComponents) const { |
- if (!coveragePOI.isSolidWhite()) { |
- return false; |
- } |
- |
- SkASSERT((NULL == solidColor) == (NULL == solidColorKnownComponents)); |
+void GrCoverageSetOpXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI, |
+ const GrProcOptInfo& coveragePOI, |
+ bool colorWriteDisabled, |
+ GrXPFactory::InvariantOutput* output) const { |
+ if (SkRegion::kReplace_Op == fRegionOp) { |
+ if (coveragePOI.isSolidWhite()) { |
+ output->fBlendedColor = GrColor_WHITE; |
+ output->fBlendedColorFlags = kRGBA_GrColorComponentFlags; |
+ } else { |
+ output->fBlendedColorFlags = 0; |
+ } |
- bool opaque = SkRegion::kReplace_Op == fRegionOp; |
- if (solidColor) { |
- if (opaque) { |
- *solidColor = GrColor_WHITE; |
- *solidColorKnownComponents = kRGBA_GrColorComponentFlags; |
+ if (coveragePOI.readsDst()) { |
+ output->fWillBlendWithDst = true; |
} else { |
- solidColorKnownComponents = 0; |
+ output->fWillBlendWithDst = false; |
} |
+ } else { |
+ output->fBlendedColorFlags = 0; |
+ output->fWillBlendWithDst = true; |
} |
- return opaque; |
} |
GR_DEFINE_XP_FACTORY_TEST(GrCoverageSetOpXPFactory); |