diff --git a/src/gpu/GrBlend.h b/src/gpu/GrBlend.h index 8d1af859f2..ad11be3668 100644 --- a/src/gpu/GrBlend.h +++ b/src/gpu/GrBlend.h @@ -93,8 +93,10 @@ static constexpr bool GrBlendCoeffsUseSrcColor(GrBlendCoeff srcCoeff, GrBlendCoe return kZero_GrBlendCoeff != srcCoeff || GrBlendCoeffRefsSrc(dstCoeff); } -static constexpr bool GrBlendCoeffsUseDstColor(GrBlendCoeff srcCoeff, GrBlendCoeff dstCoeff) { - return GrBlendCoeffRefsDst(srcCoeff) || kZero_GrBlendCoeff != dstCoeff; +static constexpr bool GrBlendCoeffsUseDstColor(GrBlendCoeff srcCoeff, GrBlendCoeff dstCoeff, + bool srcColorIsOpaque) { + return GrBlendCoeffRefsDst(srcCoeff) || + (dstCoeff != kZero_GrBlendCoeff && !(dstCoeff == kISA_GrBlendCoeff && srcColorIsOpaque)); } static constexpr bool GrBlendEquationIsAdvanced(GrBlendEquation equation) { diff --git a/src/gpu/GrProcessorSet.cpp b/src/gpu/GrProcessorSet.cpp index f4d5bd0020..ff2361b156 100644 --- a/src/gpu/GrProcessorSet.cpp +++ b/src/gpu/GrProcessorSet.cpp @@ -163,6 +163,8 @@ GrProcessorSet::Analysis GrProcessorSet::finalize( SkToBool(props & GrXPFactory::AnalysisProperties::kRequiresNonOverlappingDraws); analysis.fUsesNonCoherentHWBlending = SkToBool(props & GrXPFactory::AnalysisProperties::kUsesNonCoherentHWBlending); + analysis.fUnaffectedByDstValue = + SkToBool(props & GrXPFactory::AnalysisProperties::kUnaffectedByDstValue); if (props & GrXPFactory::AnalysisProperties::kIgnoresInputColor) { colorFPsToEliminate = this->hasColorFragmentProcessor() ? 1 : 0; analysis.fInputColorType = diff --git a/src/gpu/GrProcessorSet.h b/src/gpu/GrProcessorSet.h index 00a68e9bc3..abd8d2dc11 100644 --- a/src/gpu/GrProcessorSet.h +++ b/src/gpu/GrProcessorSet.h @@ -86,6 +86,7 @@ public: return fInputColorType == kOverridden_InputColorType; } bool usesNonCoherentHWBlending() const { return fUsesNonCoherentHWBlending; } + bool unaffectedByDstValue() const { return fUnaffectedByDstValue; } private: constexpr Analysis(Empty) @@ -96,6 +97,7 @@ public: , fHasColorFragmentProcessor(false) , fIsInitialized(true) , fUsesNonCoherentHWBlending(false) + , fUnaffectedByDstValue(false) , fInputColorType(kOriginal_InputColorType) {} enum InputColorType : uint32_t { kOriginal_InputColorType, @@ -114,6 +116,7 @@ public: PackedBool fHasColorFragmentProcessor : 1; PackedBool fIsInitialized : 1; PackedBool fUsesNonCoherentHWBlending : 1; + PackedBool fUnaffectedByDstValue : 1; PackedInputColorType fInputColorType : 2; friend class GrProcessorSet; diff --git a/src/gpu/GrXferProcessor.h b/src/gpu/GrXferProcessor.h index 100e7d76aa..c968e89ac6 100644 --- a/src/gpu/GrXferProcessor.h +++ b/src/gpu/GrXferProcessor.h @@ -290,6 +290,10 @@ public: * If set the draw will use fixed function non coherent advanced blends. */ kUsesNonCoherentHWBlending = 0x40, + /** + * If set, the existing dst value has no effect on the final output. + */ + kUnaffectedByDstValue = 0x80, }; GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(AnalysisProperties); diff --git a/src/gpu/effects/GrCoverageSetOpXP.h b/src/gpu/effects/GrCoverageSetOpXP.h index 970a079327..daab0af294 100644 --- a/src/gpu/effects/GrCoverageSetOpXP.h +++ b/src/gpu/effects/GrCoverageSetOpXP.h @@ -40,12 +40,28 @@ private: const GrCaps&, GrClampType) const override; - AnalysisProperties analysisProperties(const GrProcessorAnalysisColor&, - const GrProcessorAnalysisCoverage&, + AnalysisProperties analysisProperties(const GrProcessorAnalysisColor& color, + const GrProcessorAnalysisCoverage& coverage, bool hasMixedSamples, const GrCaps&, GrClampType) const override { - return AnalysisProperties::kIgnoresInputColor; + auto props = AnalysisProperties::kIgnoresInputColor; + switch (fRegionOp) { + case SkRegion::kReplace_Op: + props |= AnalysisProperties::kUnaffectedByDstValue; + break; + case SkRegion::kUnion_Op: + case SkRegion::kDifference_Op: + // FIXME: If we can formalize the fact that this op only operates on alpha, we can + // set AnalysisProperties::kUnaffectedByDstValue if color/coverage/hasMixedSamples + // are all opaque. + break; + case SkRegion::kIntersect_Op: + case SkRegion::kXOR_Op: + case SkRegion::kReverseDifference_Op: + break; + } + return props; } diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp index 94f07ff4fa..eee3104a60 100644 --- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp +++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp @@ -68,8 +68,13 @@ public: bool modifiesDst() const { return SkToBool(fProps & kModifiesDst_Property); } - bool usesDstColor() const { - return SkToBool(fProps & kUsesDstColor_Property); + bool unaffectedByDst() const { + return SkToBool(fProps & kUnaffectedByDst_Property); + } + // We don't always fully optimize the blend formula (e.g., for opaque src-over), so we include + // an "IfOpaque" variant to help set AnalysisProperties::kUnaffectedByDstValue in those cases. + bool unaffectedByDstIfOpaque() const { + return SkToBool(fProps & kUnaffectedByDstIfOpaque_Property); } bool usesInputColor() const { return SkToBool(fProps & kUsesInputColor_Property); @@ -100,10 +105,11 @@ public: private: enum Properties { - kModifiesDst_Property = 1, - kUsesDstColor_Property = 1 << 1, - kUsesInputColor_Property = 1 << 2, - kCanTweakAlphaForCoverage_Property = 1 << 3, + kModifiesDst_Property = 1 << 0, + kUnaffectedByDst_Property = 1 << 1, + kUnaffectedByDstIfOpaque_Property = 1 << 2, + kUsesInputColor_Property = 1 << 3, + kCanTweakAlphaForCoverage_Property = 1 << 4, kLast_Property = kCanTweakAlphaForCoverage_Property }; @@ -153,7 +159,12 @@ constexpr BlendFormula::Properties BlendFormula::GetProperties(OutputType Primar static_cast( (GrBlendModifiesDst(BlendEquation, SrcCoeff, DstCoeff) ? kModifiesDst_Property : 0) | - (GrBlendCoeffsUseDstColor(SrcCoeff, DstCoeff) ? kUsesDstColor_Property : 0) | + (!GrBlendCoeffsUseDstColor(SrcCoeff, DstCoeff, false/*srcColorIsOpaque*/) + ? kUnaffectedByDst_Property + : 0) | + (!GrBlendCoeffsUseDstColor(SrcCoeff, DstCoeff, true/*srcColorIsOpaque*/) + ? kUnaffectedByDstIfOpaque_Property + : 0) | ((PrimaryOut >= kModulate_OutputType && GrBlendCoeffsUseSrcColor(SrcCoeff, DstCoeff)) || (SecondaryOut >= kModulate_OutputType && GrBlendCoeffRefsSrc2(DstCoeff)) @@ -809,6 +820,10 @@ static inline GrXPFactory::AnalysisProperties analysis_properties( if (!formula.modifiesDst() || !formula.usesInputColor()) { props |= AnalysisProperties::kIgnoresInputColor; } + if (formula.unaffectedByDst() || (formula.unaffectedByDstIfOpaque() && color.isOpaque() && + !hasCoverage && !hasMixedSamples)) { + props |= AnalysisProperties::kUnaffectedByDstValue; + } return props; } diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp index db68eeeac5..d82339d928 100644 --- a/tests/GrPorterDuffTest.cpp +++ b/tests/GrPorterDuffTest.cpp @@ -87,6 +87,7 @@ public: GrProcessorSet::Analysis analysis = do_analysis(xpf, inputColor, inputCoverage, caps); fCompatibleWithCoverageAsAlpha = analysis.isCompatibleWithCoverageAsAlpha(); + fUnaffectedByDstValue = analysis.unaffectedByDstValue(); fIgnoresInputColor = analysis.inputColorIsIgnored(); sk_sp xp( GrXPFactory::MakeXferProcessor(xpf, inputColor, inputCoverage, false, caps, @@ -110,6 +111,7 @@ public: } bool fCompatibleWithCoverageAsAlpha; + bool fUnaffectedByDstValue; bool fIgnoresInputColor; int fPrimaryOutputType; int fSecondaryOutputType; @@ -132,6 +134,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kClear: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -142,6 +145,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kSrc: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -152,6 +156,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kDst: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -162,6 +167,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kSrcOver: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kSAModulate_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -172,6 +178,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kDstOver: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -182,6 +189,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kSrcIn: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -192,6 +200,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kDstIn: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -202,6 +211,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kSrcOut: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -212,6 +222,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kDstOut: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -222,6 +233,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kSrcATop: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -232,6 +244,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kDstATop: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -242,6 +255,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kXor: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -252,6 +266,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kPlus: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -262,6 +277,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kModulate: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -272,6 +288,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps) case SkBlendMode::kScreen: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kInvalid_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kInvalid_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -296,6 +313,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kClear: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kCoverage_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kReverseSubtract_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -306,6 +324,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kSrc: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kCoverage_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -316,6 +335,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kDst: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -326,6 +346,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kSrcOver: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -336,6 +357,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kDstOver: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -346,6 +368,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kSrcIn: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kCoverage_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -356,6 +379,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kDstIn: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kISAModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kReverseSubtract_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -366,6 +390,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kSrcOut: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kCoverage_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -376,6 +401,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kDstOut: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -386,6 +412,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kSrcATop: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -396,6 +423,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kDstATop: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kISAModulate_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -406,6 +434,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kXor: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -416,6 +445,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kPlus: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -426,6 +456,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kModulate: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kISCModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kReverseSubtract_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -436,6 +467,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kScreen: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -462,6 +494,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kClear: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(xpi.fUnaffectedByDstValue); TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -472,6 +505,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kSrc: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -482,6 +516,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kDst: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -492,6 +527,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kSrcOver: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -502,6 +538,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kDstOver: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -512,6 +549,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kSrcIn: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -522,6 +560,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kDstIn: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -532,6 +571,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kSrcOut: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -542,6 +582,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kDstOut: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -552,6 +593,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kSrcATop: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -562,6 +604,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kDstATop: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -572,6 +615,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kXor: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -582,6 +626,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kPlus: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -592,6 +637,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kModulate: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -602,6 +648,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons case SkBlendMode::kScreen: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -627,6 +674,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kClear: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kCoverage_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kReverseSubtract_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -637,6 +685,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kSrc: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -647,6 +696,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kDst: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -657,6 +707,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kSrcOver: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -667,6 +718,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kDstOver: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -677,6 +729,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kSrcIn: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -687,6 +740,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kDstIn: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -697,6 +751,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kSrcOut: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -707,6 +762,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kDstOut: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(!xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kCoverage_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kReverseSubtract_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -717,6 +773,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kSrcATop: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -727,6 +784,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kDstATop: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -737,6 +795,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kXor: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -747,6 +806,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kPlus: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -766,6 +826,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkBlendMode::kScreen: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -792,6 +853,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kClear: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(xpi.fUnaffectedByDstValue); TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -802,6 +864,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kSrc: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -812,6 +875,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kDst: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -823,6 +887,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr // We don't specialize opaque src-over. See note in GrPorterDuffXferProcessor.cpp TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -837,6 +902,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kDstOver: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -847,6 +913,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kSrcIn: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -857,6 +924,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kDstIn: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -867,6 +935,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kSrcOut: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -877,6 +946,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kDstOut: TEST_ASSERT(xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(xpi.fUnaffectedByDstValue); TEST_ASSERT(kNone_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -887,6 +957,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kSrcATop: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -897,6 +968,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kDstATop: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -907,6 +979,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kXor: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -917,6 +990,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kPlus: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -927,6 +1001,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kModulate: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -937,6 +1012,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr case SkBlendMode::kScreen: TEST_ASSERT(!xpi.fIgnoresInputColor); TEST_ASSERT(xpi.fCompatibleWithCoverageAsAlpha); + TEST_ASSERT(!xpi.fUnaffectedByDstValue); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation);