From 532b3f944a4991064963aee8f535c695f4068368 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 11 Jul 2018 10:02:07 -0400 Subject: Remove clamping of kPlus with F16 configs The most common use-case for F16 is to draw things that are explicitly outside of [0,1]. We can't prevent out-of-range values in general, users could just draw out-of-range content in src mode. We've decided that it's best to avoid surprising behavior, and trust the user in these situations. This effectively reverts https://skia-review.googlesource.com/c/skia/+/48183 Bug: skia: Change-Id: I71c2dd925c567e2862d96ab70c752f19245a69c4 Reviewed-on: https://skia-review.googlesource.com/140500 Reviewed-by: Mike Klein Reviewed-by: Brian Salomon Commit-Queue: Brian Osman --- tests/GrPorterDuffTest.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'tests/GrPorterDuffTest.cpp') diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp index 2a666a68c7..50920d3e45 100644 --- a/tests/GrPorterDuffTest.cpp +++ b/tests/GrPorterDuffTest.cpp @@ -65,8 +65,7 @@ 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, - GrPixelConfigIsClamped::kYes, &overrideColor); + procs.finalize(colorInput, coverageInput, nullptr, false, caps, &overrideColor); return analysis; } @@ -84,8 +83,7 @@ public: fCanCombineOverlappedStencilAndCover = analysis.canCombineOverlappedStencilAndCover(); fIgnoresInputColor = analysis.inputColorIsIgnored(); sk_sp xp( - GrXPFactory::MakeXferProcessor(xpf, inputColor, inputCoverage, false, caps, - GrPixelConfigIsClamped::kYes)); + GrXPFactory::MakeXferProcessor(xpf, inputColor, inputCoverage, false, caps)); TEST_ASSERT(!analysis.requiresDstTexture() || (isLCD && !caps.shaderCaps()->dstReadInShaderSupport() && @@ -1016,12 +1014,10 @@ 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, - GrPixelConfigIsClamped::kYes) & + TEST_ASSERT(!(GrXPFactory::GetAnalysisProperties(xpf, color, coverage, caps) & GrXPFactory::AnalysisProperties::kRequiresDstTexture)); sk_sp xp_opaque( - GrXPFactory::MakeXferProcessor(xpf, color, coverage, false, caps, - GrPixelConfigIsClamped::kYes)); + GrXPFactory::MakeXferProcessor(xpf, color, coverage, false, caps)); if (!xp_opaque) { ERRORF(reporter, "Failed to create an XP with LCD coverage."); return; @@ -1034,12 +1030,10 @@ 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, - GrPixelConfigIsClamped::kYes) & + TEST_ASSERT(!(GrXPFactory::GetAnalysisProperties(xpf, color, coverage, caps) & GrXPFactory::AnalysisProperties::kRequiresDstTexture)); sk_sp xp( - GrXPFactory::MakeXferProcessor(xpf, color, coverage, false, caps, - GrPixelConfigIsClamped::kYes)); + GrXPFactory::MakeXferProcessor(xpf, color, coverage, false, caps)); if (!xp) { ERRORF(reporter, "Failed to create an XP with LCD coverage."); return; @@ -1090,8 +1084,7 @@ DEF_GPUTEST(PorterDuffNoDualSourceBlending, reporter, options) { SkBlendMode xfermode = static_cast(m); const GrXPFactory* xpf = GrPorterDuffXPFactory::Get(xfermode); sk_sp xp( - GrXPFactory::MakeXferProcessor(xpf, colorInput, coverageType, false, caps, - GrPixelConfigIsClamped::kYes)); + GrXPFactory::MakeXferProcessor(xpf, colorInput, coverageType, false, caps)); if (!xp) { ERRORF(reporter, "Failed to create an XP without dual source blending."); return; -- cgit v1.2.3