diff options
author | Brian Osman <brianosman@google.com> | 2017-09-20 09:53:22 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-20 14:28:03 +0000 |
commit | 9a725dd9485654155e2e4196c32d372360bcdb61 (patch) | |
tree | 7b2b226fdffc212cce21de7d7804308dc7abbf92 /tests/GrPorterDuffTest.cpp | |
parent | 906126eedc792f12935145a9a2f13eea1d1cd86d (diff) |
Use shader based blending to clamp kPlus mode w/F16
Bug: skia:6173
Change-Id: I21042d484d9a7b3eee04aa3301d9793d00ad6908
Reviewed-on: https://skia-review.googlesource.com/48183
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tests/GrPorterDuffTest.cpp')
-rw-r--r-- | tests/GrPorterDuffTest.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp index 096219bb9a..073bdf0667 100644 --- a/tests/GrPorterDuffTest.cpp +++ b/tests/GrPorterDuffTest.cpp @@ -66,7 +66,8 @@ static GrProcessorSet::Analysis do_analysis(const GrXPFactory* xpf, GrProcessorSet procs(std::move(paint)); GrColor overrideColor; GrProcessorSet::Analysis analysis = - procs.finalize(colorInput, coverageInput, nullptr, false, caps, &overrideColor); + procs.finalize(colorInput, coverageInput, nullptr, false, caps, + GrPixelConfigIsClamped::kYes, &overrideColor); return analysis; } @@ -84,7 +85,8 @@ public: fCanCombineOverlappedStencilAndCover = analysis.canCombineOverlappedStencilAndCover(); fIgnoresInputColor = analysis.inputColorIsIgnored(); sk_sp<const GrXferProcessor> xp( - GrXPFactory::MakeXferProcessor(xpf, inputColor, inputCoverage, false, caps)); + GrXPFactory::MakeXferProcessor(xpf, inputColor, inputCoverage, false, caps, + GrPixelConfigIsClamped::kYes)); TEST_ASSERT(!analysis.requiresDstTexture() || (isLCD && !caps.shaderCaps()->dstReadInShaderSupport() && @@ -1015,10 +1017,12 @@ static void test_lcd_coverage_fallback_case(skiatest::Reporter* reporter, const const GrXPFactory* xpf = GrPorterDuffXPFactory::Get(SkBlendMode::kSrcOver); GrProcessorAnalysisColor color = GrColorPackRGBA(123, 45, 67, 255); GrProcessorAnalysisCoverage coverage = GrProcessorAnalysisCoverage::kLCD; - TEST_ASSERT(!(GrXPFactory::GetAnalysisProperties(xpf, color, coverage, caps) & + TEST_ASSERT(!(GrXPFactory::GetAnalysisProperties(xpf, color, coverage, caps, + GrPixelConfigIsClamped::kYes) & GrXPFactory::AnalysisProperties::kRequiresDstTexture)); sk_sp<const GrXferProcessor> xp_opaque( - GrXPFactory::MakeXferProcessor(xpf, color, coverage, false, caps)); + GrXPFactory::MakeXferProcessor(xpf, color, coverage, false, caps, + GrPixelConfigIsClamped::kYes)); if (!xp_opaque) { ERRORF(reporter, "Failed to create an XP with LCD coverage."); return; @@ -1031,10 +1035,12 @@ static void test_lcd_coverage_fallback_case(skiatest::Reporter* reporter, const // Test with non-opaque alpha color = GrColorPackRGBA(123, 45, 67, 221); coverage = GrProcessorAnalysisCoverage::kLCD; - TEST_ASSERT(!(GrXPFactory::GetAnalysisProperties(xpf, color, coverage, caps) & + TEST_ASSERT(!(GrXPFactory::GetAnalysisProperties(xpf, color, coverage, caps, + GrPixelConfigIsClamped::kYes) & GrXPFactory::AnalysisProperties::kRequiresDstTexture)); sk_sp<const GrXferProcessor> xp( - GrXPFactory::MakeXferProcessor(xpf, color, coverage, false, caps)); + GrXPFactory::MakeXferProcessor(xpf, color, coverage, false, caps, + GrPixelConfigIsClamped::kYes)); if (!xp) { ERRORF(reporter, "Failed to create an XP with LCD coverage."); return; @@ -1087,7 +1093,8 @@ DEF_GPUTEST(PorterDuffNoDualSourceBlending, reporter, /*factory*/) { SkBlendMode xfermode = static_cast<SkBlendMode>(m); const GrXPFactory* xpf = GrPorterDuffXPFactory::Get(xfermode); sk_sp<const GrXferProcessor> xp( - GrXPFactory::MakeXferProcessor(xpf, colorInput, coverageType, false, caps)); + GrXPFactory::MakeXferProcessor(xpf, colorInput, coverageType, false, caps, + GrPixelConfigIsClamped::kYes)); if (!xp) { ERRORF(reporter, "Failed to create an XP without dual source blending."); return; |