Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Unified Diff: src/gpu/effects/GrCoverageSetOpXP.cpp

Issue 814933002: Add an InvariantOutput for the XPF. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698