Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit cab5886

Browse files
johnstiles-googleSkia Commit-Bot
authored andcommitted
Add GrProcessor::onDumpInfo for subclass info dumps.
This CL also marks `GrProcessor::dumpInfo` as final. This prevents a subclass from mistakenly overriding `dumpInfo` instead of `onDumpInfo`. `onDumpInfo` is responsible for providing the same data as `dumpInfo`, except that the FP name is automatically prepended. Change-Id: I2b44c30a01bc65e9d88321cc21651a94e20074c6 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309793 Commit-Queue: John Stiles <johnstiles@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
1 parent 8d9bf64 commit cab5886

File tree

72 files changed

+142
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+142
-156
lines changed

src/gpu/GrProcessor.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,12 @@ class GrProcessor {
185185

186186
/** Human-readable dump of all information */
187187
#if GR_TEST_UTILS
188-
virtual SkString dumpInfo() const {
189-
return SkString(name());
188+
virtual SkString onDumpInfo() const { return SkString(); }
189+
190+
virtual SkString dumpInfo() const final {
191+
SkString info(name());
192+
info.append(this->onDumpInfo());
193+
return info;
190194
}
191195
#endif
192196

src/gpu/effects/GrBlendFragmentProcessor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class BlendFragmentProcessor : public GrFragmentProcessor {
5252
const char* name() const override { return "Blend"; }
5353

5454
#if GR_TEST_UTILS
55-
SkString dumpInfo() const override {
56-
return SkStringPrintf("BlendFragmentProcessor(fMode=%s)", SkBlendMode_Name(fMode));
55+
SkString onDumpInfo() const override {
56+
return SkStringPrintf("(fMode=%s)", SkBlendMode_Name(fMode));
5757
}
5858
#endif
5959

src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class GrGaussianConvolutionFragmentProcessor : public GrFragmentProcessor {
4141
const char* name() const override { return "GaussianConvolution"; }
4242

4343
#if GR_TEST_UTILS
44-
SkString dumpInfo() const override {
45-
return SkStringPrintf("GaussianConvolutionFragmentProcessor(dir=%s, radius=%d)",
44+
SkString onDumpInfo() const override {
45+
return SkStringPrintf("(dir=%s, radius=%d)",
4646
Direction::kX == fDirection ? "X" : "Y", fRadius);
4747
}
4848
#endif

src/gpu/effects/GrYUVtoRGBEffect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ GrYUVtoRGBEffect::GrYUVtoRGBEffect(std::unique_ptr<GrFragmentProcessor> planeFPs
184184
}
185185

186186
#if GR_TEST_UTILS
187-
SkString GrYUVtoRGBEffect::dumpInfo() const {
188-
SkString str("YUVtoRGBEffect(");
187+
SkString GrYUVtoRGBEffect::onDumpInfo() const {
188+
SkString str("(");
189189
for (int i = 0; i < 4; ++i) {
190190
str.appendf("YUVAIndices[%d]=%d %d, ",
191191
i, fYUVAIndices[i].fIndex, static_cast<int>(fYUVAIndices[i].fChannel));

src/gpu/effects/GrYUVtoRGBEffect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class GrYUVtoRGBEffect : public GrFragmentProcessor {
2424
const SkRect* subset = nullptr,
2525
const SkRect* domain = nullptr);
2626
#if GR_TEST_UTILS
27-
SkString dumpInfo() const override;
27+
SkString onDumpInfo() const override;
2828
#endif
2929

3030
std::unique_ptr<GrFragmentProcessor> clone() const override;

src/gpu/effects/generated/GrAARectEffect.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ std::unique_ptr<GrFragmentProcessor> GrAARectEffect::clone() const {
111111
return std::make_unique<GrAARectEffect>(*this);
112112
}
113113
#if GR_TEST_UTILS
114-
SkString GrAARectEffect::dumpInfo() const {
115-
return SkStringPrintf("AARectEffect(edgeType=%d, rect=float4(%f, %f, %f, %f))", (int)edgeType,
116-
rect.left(), rect.top(), rect.right(), rect.bottom());
114+
SkString GrAARectEffect::onDumpInfo() const {
115+
return SkStringPrintf("(edgeType=%d, rect=float4(%f, %f, %f, %f))", (int)edgeType, rect.left(),
116+
rect.top(), rect.right(), rect.bottom());
117117
}
118118
#endif
119119
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrAARectEffect);

src/gpu/effects/generated/GrAARectEffect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class GrAARectEffect : public GrFragmentProcessor {
2626
}
2727
GrAARectEffect(const GrAARectEffect& src);
2828
#if GR_TEST_UTILS
29-
SkString dumpInfo() const override;
29+
SkString onDumpInfo() const override;
3030
#endif
3131
std::unique_ptr<GrFragmentProcessor> clone() const override;
3232
const char* name() const override { return "AARectEffect"; }

src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,8 @@ std::unique_ptr<GrFragmentProcessor> GrAlphaThresholdFragmentProcessor::clone()
9797
return std::make_unique<GrAlphaThresholdFragmentProcessor>(*this);
9898
}
9999
#if GR_TEST_UTILS
100-
SkString GrAlphaThresholdFragmentProcessor::dumpInfo() const {
101-
return SkStringPrintf("AlphaThresholdFragmentProcessor(innerThreshold=%f, outerThreshold=%f)",
102-
innerThreshold, outerThreshold);
100+
SkString GrAlphaThresholdFragmentProcessor::onDumpInfo() const {
101+
return SkStringPrintf("(innerThreshold=%f, outerThreshold=%f)", innerThreshold, outerThreshold);
103102
}
104103
#endif
105104
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrAlphaThresholdFragmentProcessor);

src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class GrAlphaThresholdFragmentProcessor : public GrFragmentProcessor {
2727
}
2828
GrAlphaThresholdFragmentProcessor(const GrAlphaThresholdFragmentProcessor& src);
2929
#if GR_TEST_UTILS
30-
SkString dumpInfo() const override;
30+
SkString onDumpInfo() const override;
3131
#endif
3232
std::unique_ptr<GrFragmentProcessor> clone() const override;
3333
const char* name() const override { return "AlphaThresholdFragmentProcessor"; }

src/gpu/effects/generated/GrArithmeticProcessor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ std::unique_ptr<GrFragmentProcessor> GrArithmeticProcessor::clone() const {
8282
return std::make_unique<GrArithmeticProcessor>(*this);
8383
}
8484
#if GR_TEST_UTILS
85-
SkString GrArithmeticProcessor::dumpInfo() const {
86-
return SkStringPrintf("ArithmeticProcessor(k=float4(%f, %f, %f, %f), enforcePMColor=%s)", k.x,
87-
k.y, k.z, k.w, (enforcePMColor ? "true" : "false"));
85+
SkString GrArithmeticProcessor::onDumpInfo() const {
86+
return SkStringPrintf("(k=float4(%f, %f, %f, %f), enforcePMColor=%s)", k.x, k.y, k.z, k.w,
87+
(enforcePMColor ? "true" : "false"));
8888
}
8989
#endif
9090
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrArithmeticProcessor);

0 commit comments

Comments
 (0)