Revert "Revert "Remove GrPipeline from GrDrawOp.""
This reverts commit c48af934608bbb65650641f66adb51f2102d4274.
Change-Id: I4ba78fd7e5a7d406b88223ca6f7245c029b60f76
Reviewed-on: https://skia-review.googlesource.com/9981
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp
index ddca03a..de18438 100644
--- a/tests/GrPorterDuffTest.cpp
+++ b/tests/GrPorterDuffTest.cpp
@@ -9,7 +9,6 @@
#if SK_SUPPORT_GPU
-#include "GrAppliedClip.h"
#include "GrContextFactory.h"
#include "GrContextOptions.h"
#include "GrGpu.h"
@@ -68,7 +67,10 @@
XPInfo(skiatest::Reporter* reporter, SkBlendMode xfermode, const GrCaps& caps,
const GrProcessorSet::FragmentProcessorAnalysis& analysis) {
const GrXPFactory* xpf = GrPorterDuffXPFactory::Get(xfermode);
- fReadsDst = GrXPFactory::WillReadDst(xpf, analysis);
+ // The GrXPFactory query assumes no coverage.
+ fCanCombineOverlappedStencilAndCover =
+ !analysis.hasCoverage() && GrXPFactory::CanCombineOverlappedStencilAndCover(
+ xpf, analysis.isOutputColorOpaque());
sk_sp<GrXferProcessor> xp(xpf->createXferProcessor(analysis, false, nullptr, caps));
TEST_ASSERT(!GrXPFactory::WillNeedDstTexture(xpf, caps, analysis));
fOptFlags = xp->getOptimizations(analysis);
@@ -78,7 +80,7 @@
TEST_ASSERT(xp->hasSecondaryOutput() == GrBlendCoeffRefsSrc2(fBlendInfo.fDstBlend));
}
- bool fReadsDst;
+ bool fCanCombineOverlappedStencilAndCover;
int fOptFlags;
int fPrimaryOutputType;
int fSecondaryOutputType;
@@ -104,7 +106,7 @@
const GrPorterDuffTest::XPInfo xpi(reporter, xfermode, caps, analysis);
switch (xfermode) {
case SkBlendMode::kClear:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kIgnoreColor_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kCoverage_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -114,7 +116,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrc:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kCoverage_OutputType == xpi.fSecondaryOutputType);
@@ -124,7 +126,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDst:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kIgnoreColor_OptFlag |
kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType);
@@ -135,7 +137,7 @@
TEST_ASSERT(!xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcOver:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kSAModulate_OutputType == xpi.fSecondaryOutputType);
@@ -145,7 +147,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstOver:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -155,7 +157,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcIn:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kCoverage_OutputType == xpi.fSecondaryOutputType);
@@ -165,7 +167,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstIn:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kISAModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -175,7 +177,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcOut:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kCoverage_OutputType == xpi.fSecondaryOutputType);
@@ -185,7 +187,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstOut:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kSAModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -195,7 +197,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcATop:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kSAModulate_OutputType == xpi.fSecondaryOutputType);
@@ -205,7 +207,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstATop:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kISAModulate_OutputType == xpi.fSecondaryOutputType);
@@ -215,7 +217,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kXor:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kSAModulate_OutputType == xpi.fSecondaryOutputType);
@@ -225,7 +227,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kPlus:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -235,7 +237,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kModulate:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kISCModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -245,7 +247,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kScreen:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -273,7 +275,7 @@
const GrPorterDuffTest::XPInfo xpi(reporter, xfermode, caps, analysis);
switch (xfermode) {
case SkBlendMode::kClear:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kIgnoreColor_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kCoverage_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -283,7 +285,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrc:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kCoverage_OutputType == xpi.fSecondaryOutputType);
@@ -293,7 +295,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDst:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kIgnoreColor_OptFlag |
kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType);
@@ -304,7 +306,7 @@
TEST_ASSERT(!xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcOver:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -314,7 +316,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstOver:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -324,7 +326,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcIn:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kCoverage_OutputType == xpi.fSecondaryOutputType);
@@ -334,7 +336,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstIn:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kISAModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -344,7 +346,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcOut:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kCoverage_OutputType == xpi.fSecondaryOutputType);
@@ -354,7 +356,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstOut:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -364,7 +366,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcATop:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -374,7 +376,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstATop:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kISAModulate_OutputType == xpi.fSecondaryOutputType);
@@ -384,7 +386,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kXor:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -394,7 +396,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kPlus:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -404,7 +406,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kModulate:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kISCModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -414,7 +416,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kScreen:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -443,7 +445,7 @@
const GrPorterDuffTest::XPInfo xpi(reporter, xfermode, caps, analysis);
switch (xfermode) {
case SkBlendMode::kClear:
- TEST_ASSERT(!xpi.fReadsDst);
+ TEST_ASSERT(xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kIgnoreColor_OptFlag == xpi.fOptFlags);
TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -453,7 +455,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrc:
- TEST_ASSERT(!xpi.fReadsDst);
+ TEST_ASSERT(xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kNone_OptFlags == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -463,7 +465,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDst:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kIgnoreColor_OptFlag |
kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType);
@@ -474,7 +476,7 @@
TEST_ASSERT(!xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcOver:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -484,7 +486,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstOver:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kCanTweakAlphaForCoverage_OptFlag == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -494,7 +496,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcIn:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kNone_OptFlags == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -504,7 +506,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstIn:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kNone_OptFlags == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -514,7 +516,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcOut:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kNone_OptFlags == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -524,7 +526,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstOut:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kCanTweakAlphaForCoverage_OptFlag == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -534,7 +536,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcATop:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kCanTweakAlphaForCoverage_OptFlag == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -544,7 +546,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstATop:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kNone_OptFlags == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -554,7 +556,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kXor:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kCanTweakAlphaForCoverage_OptFlag == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -564,7 +566,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kPlus:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kCanTweakAlphaForCoverage_OptFlag == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -574,7 +576,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kModulate:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kNone_OptFlags == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -584,7 +586,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kScreen:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kCanTweakAlphaForCoverage_OptFlag == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -614,7 +616,7 @@
const GrPorterDuffTest::XPInfo xpi(reporter, xfermode, caps, analysis);
switch (xfermode) {
case SkBlendMode::kClear:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kIgnoreColor_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kCoverage_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -624,7 +626,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrc:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -634,7 +636,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDst:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kIgnoreColor_OptFlag |
kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType);
@@ -645,7 +647,7 @@
TEST_ASSERT(!xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcOver:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -655,7 +657,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstOver:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -665,7 +667,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcIn:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -675,7 +677,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstIn:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kIgnoreColor_OptFlag |
kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType);
@@ -686,7 +688,7 @@
TEST_ASSERT(!xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcOut:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -696,7 +698,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstOut:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kIgnoreColor_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kCoverage_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -706,7 +708,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcATop:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -716,7 +718,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstATop:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -726,7 +728,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kXor:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -736,7 +738,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kPlus:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -746,7 +748,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kModulate:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags);
TEST_ASSERT(kISCModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -756,7 +758,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kScreen:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -786,7 +788,7 @@
switch (xfermode) {
case SkBlendMode::kClear:
- TEST_ASSERT(!xpi.fReadsDst);
+ TEST_ASSERT(xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kIgnoreColor_OptFlag == xpi.fOptFlags);
TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -796,7 +798,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrc:
- TEST_ASSERT(!xpi.fReadsDst);
+ TEST_ASSERT(xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kNone_OptFlags == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -806,7 +808,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDst:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kIgnoreColor_OptFlag |
kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType);
@@ -817,7 +819,7 @@
TEST_ASSERT(!xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcOver:
- TEST_ASSERT(!xpi.fReadsDst);
+ TEST_ASSERT(xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kNone_OptFlags == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -827,7 +829,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstOver:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kCanTweakAlphaForCoverage_OptFlag == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -837,7 +839,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcIn:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kNone_OptFlags == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -847,7 +849,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstIn:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT((kIgnoreColor_OptFlag |
kCanTweakAlphaForCoverage_OptFlag) == xpi.fOptFlags);
TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType);
@@ -858,7 +860,7 @@
TEST_ASSERT(!xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcOut:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kNone_OptFlags == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -868,7 +870,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstOut:
- TEST_ASSERT(!xpi.fReadsDst);
+ TEST_ASSERT(xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kIgnoreColor_OptFlag == xpi.fOptFlags);
TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -878,7 +880,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kSrcATop:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kNone_OptFlags == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -888,7 +890,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kDstATop:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kCanTweakAlphaForCoverage_OptFlag == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -898,7 +900,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kXor:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kNone_OptFlags == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -908,7 +910,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kPlus:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kCanTweakAlphaForCoverage_OptFlag == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -918,7 +920,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kModulate:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kNone_OptFlags == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -928,7 +930,7 @@
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
break;
case SkBlendMode::kScreen:
- TEST_ASSERT(xpi.fReadsDst);
+ TEST_ASSERT(!xpi.fCanCombineOverlappedStencilAndCover);
TEST_ASSERT(kCanTweakAlphaForCoverage_OptFlag == xpi.fOptFlags);
TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType);
TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType);
@@ -961,15 +963,14 @@
}
void applyPipelineOptimizations(const GrPipelineOptimizations&) override {}
- bool onCombineIfPossible(GrOp*, const GrCaps&) override { return false; }
+ bool onCombineIfPossible(GrOp*, const GrCaps&) override { return false; }
void onPrepareDraws(Target*) const override {}
typedef GrMeshDrawOp INHERITED;
} testLCDCoverageOp;
GrProcessorSet::FragmentProcessorAnalysis analysis;
- GrAppliedClip clip;
- testLCDCoverageOp.analyzeProcessors(&analysis, GrProcessorSet(GrPaint()), &clip, caps);
+ testLCDCoverageOp.analyzeProcessors(&analysis, GrProcessorSet(GrPaint()), nullptr, caps);
SkASSERT(analysis.hasKnownOutputColor());
SkASSERT(analysis.hasLCDCoverage());
@@ -983,8 +984,6 @@
return;
}
- TEST_ASSERT(GrXPFactory::WillReadDst(xpf, analysis));
-
xp->getOptimizations(analysis);
GrXferProcessor::BlendInfo blendInfo;