diff options
author | Chris Dalton <csmartdalton@google.com> | 2019-01-23 11:36:47 -0700 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2019-01-23 22:19:11 +0000 |
commit | 8d8224fcc12774853ad14a1256c4fdbb8bae4c3e (patch) | |
tree | a6abcd296c99db5ff1f4b72fec88008623ba3816 /src | |
parent | 2dd7f3bf2393d421ad549fc97a32e3b5a015eff9 (diff) | |
download | skqp-8d8224fcc12774853ad14a1256c4fdbb8bae4c3e.tar.gz |
Implement XP factory dumping
Bug: skia:
Change-Id: If2e6a20b072d895ca9770268db5006a9400f2e70
Reviewed-on: https://skia-review.googlesource.com/c/186180
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrProcessorSet.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrXferProcessor.h | 9 | ||||
-rw-r--r-- | src/gpu/effects/GrCoverageSetOpXP.h | 5 | ||||
-rw-r--r-- | src/gpu/effects/GrCustomXfermode.cpp | 4 | ||||
-rw-r--r-- | src/gpu/effects/GrDisableColorXP.h | 2 | ||||
-rw-r--r-- | src/gpu/effects/GrPorterDuffXferProcessor.h | 4 |
6 files changed, 25 insertions, 1 deletions
diff --git a/src/gpu/GrProcessorSet.cpp b/src/gpu/GrProcessorSet.cpp index 478d250c67..7376b70929 100644 --- a/src/gpu/GrProcessorSet.cpp +++ b/src/gpu/GrProcessorSet.cpp @@ -124,7 +124,7 @@ SkString GrProcessorSet::dumpProcessors() const { result.append("SrcOver\n"); } } else { - result.append("XP Factory dumping not implemented.\n"); + result.appendf("XP Factory: %s\n", GrXPFactory::GetDescription(this->xpFactory()).c_str()); } return result; } diff --git a/src/gpu/GrXferProcessor.h b/src/gpu/GrXferProcessor.h index 295bf00102..8e484b0d38 100644 --- a/src/gpu/GrXferProcessor.h +++ b/src/gpu/GrXferProcessor.h @@ -282,6 +282,10 @@ public: }; GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(AnalysisProperties); + static SkString GetDescription(const GrXPFactory* xpf) { + return (!xpf) ? SkString("none (src-over)") : xpf->description(); + } + static sk_sp<const GrXferProcessor> MakeXferProcessor(const GrXPFactory*, const GrProcessorAnalysisColor&, GrProcessorAnalysisCoverage, @@ -297,6 +301,11 @@ protected: constexpr GrXPFactory() {} private: + /** + * Human-meaningful string to identify this factory. + */ + virtual SkString description() const = 0; + virtual sk_sp<const GrXferProcessor> makeXferProcessor(const GrProcessorAnalysisColor&, GrProcessorAnalysisCoverage, bool hasMixedSamples, diff --git a/src/gpu/effects/GrCoverageSetOpXP.h b/src/gpu/effects/GrCoverageSetOpXP.h index e8bc5a223f..114f5b7fec 100644 --- a/src/gpu/effects/GrCoverageSetOpXP.h +++ b/src/gpu/effects/GrCoverageSetOpXP.h @@ -34,6 +34,11 @@ public: private: constexpr GrCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage); + SkString description() const override { + return SkStringPrintf("GrCoverageSetOpXPFactory (%s; invert=%i)", + SkRegion::OpName(fRegionOp), fInvertCoverage); + } + sk_sp<const GrXferProcessor> makeXferProcessor(const GrProcessorAnalysisColor&, GrProcessorAnalysisCoverage, bool hasMixedSamples, diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp index 86e7037193..9bb4b646b6 100644 --- a/src/gpu/effects/GrCustomXfermode.cpp +++ b/src/gpu/effects/GrCustomXfermode.cpp @@ -217,6 +217,10 @@ public: : fMode(mode), fHWBlendEquation(hw_blend_equation(mode)) {} private: + SkString description() const override { + return SkStringPrintf("CustomXPFactory (%s)", SkBlendMode_Name(fMode)); + } + sk_sp<const GrXferProcessor> makeXferProcessor(const GrProcessorAnalysisColor&, GrProcessorAnalysisCoverage, bool hasMixedSamples, diff --git a/src/gpu/effects/GrDisableColorXP.h b/src/gpu/effects/GrDisableColorXP.h index d15f9525c8..4b0dab611b 100644 --- a/src/gpu/effects/GrDisableColorXP.h +++ b/src/gpu/effects/GrDisableColorXP.h @@ -28,6 +28,8 @@ public: private: constexpr GrDisableColorXPFactory() {} + SkString description() const override { return SkString("GrDisableColorXPFactory"); } + AnalysisProperties analysisProperties(const GrProcessorAnalysisColor&, const GrProcessorAnalysisCoverage&, const GrCaps&) const override { diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.h b/src/gpu/effects/GrPorterDuffXferProcessor.h index ebe02126d2..3d63fe165f 100644 --- a/src/gpu/effects/GrPorterDuffXferProcessor.h +++ b/src/gpu/effects/GrPorterDuffXferProcessor.h @@ -46,6 +46,10 @@ public: private: constexpr GrPorterDuffXPFactory(SkBlendMode); + SkString description() const override { + return SkStringPrintf("GrPorterDuffXPFactory (%s)", SkBlendMode_Name(fBlendMode)); + } + sk_sp<const GrXferProcessor> makeXferProcessor(const GrProcessorAnalysisColor&, GrProcessorAnalysisCoverage, bool hasMixedSamples, |