aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-09-20 09:53:22 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-20 14:28:03 +0000
commit9a725dd9485654155e2e4196c32d372360bcdb61 (patch)
tree7b2b226fdffc212cce21de7d7804308dc7abbf92 /tests
parent906126eedc792f12935145a9a2f13eea1d1cd86d (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')
-rw-r--r--tests/GrMeshTest.cpp3
-rw-r--r--tests/GrPipelineDynamicStateTest.cpp3
-rw-r--r--tests/GrPorterDuffTest.cpp21
-rw-r--r--tests/OnFlushCallbackTest.cpp7
-rw-r--r--tests/PrimitiveProcessorTest.cpp3
-rw-r--r--tests/ProcessorTest.cpp5
6 files changed, 27 insertions, 15 deletions
diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp
index d174675c16..dac9deba6b 100644
--- a/tests/GrMeshTest.cpp
+++ b/tests/GrMeshTest.cpp
@@ -262,7 +262,8 @@ public:
private:
const char* name() const override { return "GrMeshTestOp"; }
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*) override {
+ RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*,
+ GrPixelConfigIsClamped) 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 1f3dccd885..1d148cff83 100644
--- a/tests/GrPipelineDynamicStateTest.cpp
+++ b/tests/GrPipelineDynamicStateTest.cpp
@@ -119,7 +119,8 @@ public:
private:
const char* name() const override { return "GrPipelineDynamicStateTestOp"; }
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*) override {
+ RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*,
+ GrPixelConfigIsClamped) 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 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;
diff --git a/tests/OnFlushCallbackTest.cpp b/tests/OnFlushCallbackTest.cpp
index 51c1985ee1..e47a76bb52 100644
--- a/tests/OnFlushCallbackTest.cpp
+++ b/tests/OnFlushCallbackTest.cpp
@@ -64,14 +64,15 @@ public:
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- RequiresDstTexture finalize(const GrCaps& caps, const GrAppliedClip*) override {
+ RequiresDstTexture finalize(const GrCaps& caps, const GrAppliedClip*,
+ GrPixelConfigIsClamped dstIsClamped) 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, GrProcessorAnalysisCoverage::kNone,
- &gpColor);
+ return fHelper.xpRequiresDstTexture(caps, &kNoClip, dstIsClamped,
+ GrProcessorAnalysisCoverage::kNone, &gpColor);
}
protected:
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp
index 47dff33755..6402020458 100644
--- a/tests/PrimitiveProcessorTest.cpp
+++ b/tests/PrimitiveProcessorTest.cpp
@@ -38,7 +38,8 @@ public:
return FixedFunctionFlags::kNone;
}
- RequiresDstTexture finalize(const GrCaps& caps, const GrAppliedClip* clip) override {
+ RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*,\
+ GrPixelConfigIsClamped) override {
return RequiresDstTexture::kNo;
}
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index 9655193e84..056302ea66 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -37,11 +37,12 @@ public:
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
- RequiresDstTexture finalize(const GrCaps& caps, const GrAppliedClip* clip) override {
+ RequiresDstTexture finalize(const GrCaps& caps, const GrAppliedClip* clip,
+ GrPixelConfigIsClamped dstIsClamped) override {
static constexpr GrProcessorAnalysisColor kUnknownColor;
GrColor overrideColor;
fProcessors.finalize(kUnknownColor, GrProcessorAnalysisCoverage::kNone, clip, false, caps,
- &overrideColor);
+ dstIsClamped, &overrideColor);
return RequiresDstTexture::kNo;
}