diff options
author | Brian Osman <brianosman@google.com> | 2018-07-11 10:02:07 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-11 14:30:58 +0000 |
commit | 532b3f944a4991064963aee8f535c695f4068368 (patch) | |
tree | 671769fb6808a70240c1f857594e7f36b4ae8074 /tests | |
parent | c87cfb674bcaf27062dd11f88f1337af70173a11 (diff) |
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 <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/DrawOpAtlasTest.cpp | 2 | ||||
-rw-r--r-- | tests/GrMeshTest.cpp | 3 | ||||
-rw-r--r-- | tests/GrPipelineDynamicStateTest.cpp | 3 | ||||
-rw-r--r-- | tests/GrPorterDuffTest.cpp | 21 | ||||
-rw-r--r-- | tests/LazyProxyTest.cpp | 9 | ||||
-rw-r--r-- | tests/OnFlushCallbackTest.cpp | 7 | ||||
-rw-r--r-- | tests/PrimitiveProcessorTest.cpp | 3 | ||||
-rw-r--r-- | tests/ProcessorTest.cpp | 5 |
8 files changed, 19 insertions, 34 deletions
diff --git a/tests/DrawOpAtlasTest.cpp b/tests/DrawOpAtlasTest.cpp index e065bf0249..97524cd860 100644 --- a/tests/DrawOpAtlasTest.cpp +++ b/tests/DrawOpAtlasTest.cpp @@ -202,7 +202,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrAtlasTextOpPreparation, reporter, ctxInfo) rtc.get(), paint, SkMatrix::I(), text, 16, 16); - op->finalize(*context->contextPriv().caps(), nullptr, GrPixelConfigIsClamped::kNo); + op->finalize(*context->contextPriv().caps(), nullptr); TestingUploadTarget uploadTarget; diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp index aa951c0364..3417a7eb37 100644 --- a/tests/GrMeshTest.cpp +++ b/tests/GrMeshTest.cpp @@ -275,8 +275,7 @@ private: const char* name() const override { return "GrMeshTestOp"; } FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; } - RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*, - GrPixelConfigIsClamped) override { + RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*) override { return RequiresDstTexture::kNo; } bool onCombineIfPossible(GrOp* other, const GrCaps& caps) override { return false; } diff --git a/tests/GrPipelineDynamicStateTest.cpp b/tests/GrPipelineDynamicStateTest.cpp index b2aaecc48b..8752e61e7f 100644 --- a/tests/GrPipelineDynamicStateTest.cpp +++ b/tests/GrPipelineDynamicStateTest.cpp @@ -133,8 +133,7 @@ private: const char* name() const override { return "GrPipelineDynamicStateTestOp"; } FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; } - RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*, - GrPixelConfigIsClamped) override { + RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*) override { return RequiresDstTexture::kNo; } bool onCombineIfPossible(GrOp* other, const GrCaps& caps) override { return false; } 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<const GrXferProcessor> 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<const GrXferProcessor> 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<const GrXferProcessor> 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<SkBlendMode>(m); const GrXPFactory* xpf = GrPorterDuffXPFactory::Get(xfermode); sk_sp<const GrXferProcessor> 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; diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp index aaf1ab9745..7945ec6714 100644 --- a/tests/LazyProxyTest.cpp +++ b/tests/LazyProxyTest.cpp @@ -106,8 +106,7 @@ public: const char* name() const override { return "LazyProxyTest::Op"; } FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; } - RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*, - GrPixelConfigIsClamped) override { + RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*) override { return RequiresDstTexture::kNo; } bool onCombineIfPossible(GrOp* other, const GrCaps& caps) override { return false; } @@ -321,8 +320,7 @@ private: const char* name() const override { return "LazyFailedInstantiationTestOp"; } FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; } - RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*, - GrPixelConfigIsClamped) override { + RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*) override { return RequiresDstTexture::kNo; } bool onCombineIfPossible(GrOp* other, const GrCaps& caps) override { return false; } @@ -396,8 +394,7 @@ private: const char* name() const override { return "LazyUninstantiateTestOp"; } FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; } - RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*, - GrPixelConfigIsClamped) override { + RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*) override { return RequiresDstTexture::kNo; } bool onCombineIfPossible(GrOp* other, const GrCaps& caps) override { return false; } diff --git a/tests/OnFlushCallbackTest.cpp b/tests/OnFlushCallbackTest.cpp index c60ae7c7da..ea871fbf44 100644 --- a/tests/OnFlushCallbackTest.cpp +++ b/tests/OnFlushCallbackTest.cpp @@ -72,15 +72,14 @@ public: FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; } - RequiresDstTexture finalize(const GrCaps& caps, const GrAppliedClip*, - GrPixelConfigIsClamped dstIsClamped) override { + RequiresDstTexture finalize(const GrCaps& caps, const GrAppliedClip*) override { // Set the color to unknown because the subclass may change the color later. GrProcessorAnalysisColor gpColor; gpColor.setToUnknown(); // We ignore the clip so pass this rather than the GrAppliedClip param. static GrAppliedClip kNoClip; - return fHelper.xpRequiresDstTexture(caps, &kNoClip, dstIsClamped, - GrProcessorAnalysisCoverage::kNone, &gpColor); + return fHelper.xpRequiresDstTexture(caps, &kNoClip, GrProcessorAnalysisCoverage::kNone, + &gpColor); } protected: diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp index e9fbfd101a..661c1ce7f1 100644 --- a/tests/PrimitiveProcessorTest.cpp +++ b/tests/PrimitiveProcessorTest.cpp @@ -42,8 +42,7 @@ public: return FixedFunctionFlags::kNone; } - RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*,\ - GrPixelConfigIsClamped) override { + RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*) override { return RequiresDstTexture::kNo; } diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp index e52070b7d2..4eb735f325 100644 --- a/tests/ProcessorTest.cpp +++ b/tests/ProcessorTest.cpp @@ -42,12 +42,11 @@ public: FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; } - RequiresDstTexture finalize(const GrCaps& caps, const GrAppliedClip* clip, - GrPixelConfigIsClamped dstIsClamped) override { + RequiresDstTexture finalize(const GrCaps& caps, const GrAppliedClip* clip) override { static constexpr GrProcessorAnalysisColor kUnknownColor; GrColor overrideColor; fProcessors.finalize(kUnknownColor, GrProcessorAnalysisCoverage::kNone, clip, false, caps, - dstIsClamped, &overrideColor); + &overrideColor); return RequiresDstTexture::kNo; } |