Guard dumpInfo() calls with GR_TEST_UTILS, instead of SK_DEBUG.

(One exception: the `dumpInfo` in GrVkCommandPool is wrapped with
SK_TRACE_MANAGED_RESOURCES to match its peers in GrVkManagedResource.)

Change-Id: I6cf55fa2bb5687f79a2cc0c2a9c02a629bfd4f8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309556
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
John Stiles 2020-08-11 23:17:35 -04:00 committed by Skia Commit-Bot
parent 47b4e22303
commit 26900788ef
38 changed files with 49 additions and 47 deletions

View File

@ -75,7 +75,7 @@ const GrTextureEffect* GrFragmentProcessor::asTextureEffect() const {
return nullptr;
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
static void recursive_dump_tree_info(const GrFragmentProcessor& fp,
SkString indent,
SkString* text) {

View File

@ -250,7 +250,7 @@ public:
GrTextureEffect* asTextureEffect();
const GrTextureEffect* asTextureEffect() const;
#ifdef SK_DEBUG
#if GR_TEST_UTILS
// Generates debug info for this processor tree by recursively calling dumpInfo() on this
// processor and its children.
SkString dumpTreeInfo() const;

View File

@ -184,7 +184,7 @@ public:
virtual const char* name() const = 0;
/** Human-readable dump of all information */
#ifdef SK_DEBUG
#if GR_TEST_UTILS
virtual SkString dumpInfo() const {
return SkString(name());
}

View File

@ -49,7 +49,7 @@ GrProcessorSet::~GrProcessorSet() {
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString GrProcessorSet::dumpProcessors() const {
SkString result;
if (this->hasColorFragmentProcessor()) {

View File

@ -143,7 +143,7 @@ public:
static GrProcessorSet MakeEmptySet();
static constexpr Analysis EmptySetAnalysis() { return Analysis(Empty::kEmpty); }
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpProcessors() const;
#endif

View File

@ -51,7 +51,7 @@ public:
const char* name() const override { return "Blend"; }
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
return SkStringPrintf("BlendFragmentProcessor(fMode=%s)", SkBlendMode_Name(fMode));
}

View File

@ -40,7 +40,7 @@ public:
const char* name() const override { return "GaussianConvolution"; }
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
return SkStringPrintf("GaussianConvolutionFragmentProcessor(dir=%s, radius=%d)",
Direction::kX == fDirection ? "X" : "Y", fRadius);

View File

@ -183,7 +183,7 @@ GrYUVtoRGBEffect::GrYUVtoRGBEffect(std::unique_ptr<GrFragmentProcessor> planeFPs
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString GrYUVtoRGBEffect::dumpInfo() const {
SkString str("YUVtoRGBEffect(");
for (int i = 0; i < 4; ++i) {

View File

@ -23,7 +23,7 @@ public:
const SkMatrix& localMatrix = SkMatrix::I(),
const SkRect* subset = nullptr,
const SkRect* domain = nullptr);
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override;
#endif

View File

@ -724,7 +724,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.appendf("Count: %d\n", fPaths.count());

View File

@ -856,7 +856,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.appendf("Color: 0x%08x Coverage: 0x%02x, Count: %d\n", fColor.toBytes_RGBA(),

View File

@ -186,7 +186,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (const auto& path : fPaths) {

View File

@ -92,7 +92,7 @@ void GrAtlasTextOp::visitProxies(const VisitProxyFunc& func) const {
fProcessors.visitProxies(func);
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString GrAtlasTextOp::dumpInfo() const {
SkString str;

View File

@ -43,7 +43,7 @@ public:
void visitProxies(const VisitProxyFunc& func) const override;
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override;
#endif

View File

@ -30,7 +30,7 @@ public:
const char* name() const override { return "Clear"; }
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.append(INHERITED::dumpInfo());

View File

@ -244,7 +244,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (const auto& geo : fLines) {

View File

@ -369,7 +369,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.appendf("Color: 0x%08x Count: %d\n", fColor.toBytes_RGBA(), fPaths.count());

View File

@ -44,7 +44,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override;
#endif
@ -186,7 +186,7 @@ DrawAtlasOp::DrawAtlasOp(const Helper::MakeArgs& helperArgs, const SkPMColor4f&
this->setTransformedBounds(bounds, viewMatrix, HasAABloat::kNo, IsHairline::kNo);
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString DrawAtlasOp::dumpInfo() const {
SkString string;
for (const auto& geo : fGeoData) {

View File

@ -37,7 +37,7 @@ GrDrawPathOpBase::GrDrawPathOpBase(uint32_t classID, const SkMatrix& viewMatrix,
, fDoAA(GrAA::kYes == aa)
, fProcessorSet(std::move(paint)) {}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString GrDrawPathOp::dumpInfo() const {
SkString string;
string.printf("PATH: 0x%p", fPath.get());

View File

@ -80,7 +80,7 @@ public:
const char* name() const override { return "DrawPath"; }
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override;
#endif

View File

@ -455,7 +455,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override;
#endif
@ -581,7 +581,7 @@ DrawVerticesOp::DrawVerticesOp(const Helper::MakeArgs& helperArgs,
zeroArea);
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString DrawVerticesOp::dumpInfo() const {
SkString string;
string.appendf("PrimType: %d, MeshCount %d, VCount: %d, ICount: %d\n", (int)fPrimitiveType,

View File

@ -26,7 +26,7 @@ public:
const char* name() const override { return "Drawable"; }
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
return INHERITED::dumpInfo();
}

View File

@ -29,7 +29,7 @@ namespace {
using VertexSpec = GrQuadPerEdgeAA::VertexSpec;
using ColorType = GrQuadPerEdgeAA::ColorType;
#ifdef SK_DEBUG
#if GR_TEST_UTILS
static SkString dump_quad_info(int index, const GrQuad* deviceQuad,
const GrQuad* localQuad, const SkPMColor4f& color,
GrQuadAAFlags aaFlags) {
@ -120,7 +120,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString str;
str.appendf("# draws: %u\n", fQuads.count());

View File

@ -173,7 +173,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString str;

View File

@ -180,7 +180,7 @@ public:
}
/** Used for spewing information about ops when debugging. */
#ifdef SK_DEBUG
#if GR_TEST_UTILS
virtual SkString dumpInfo() const {
SkString string;
string.appendf("OpBounds: [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n",

View File

@ -1226,7 +1226,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (int i = 0; i < fCircles.count(); ++i) {
@ -1588,7 +1588,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (int i = 0; i < fCircles.count(); ++i) {
@ -1919,7 +1919,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.appendf("Stroked: %d\n", fStroked);
@ -2196,7 +2196,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (const auto& geo : fEllipses) {
@ -2546,7 +2546,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (int i = 0; i < fRRects.count(); ++i) {
@ -2918,7 +2918,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.appendf("Stroked: %d\n", fStroked);

View File

@ -72,7 +72,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString str;
str.appendf("# combined: %d\n", fRegions.count());

View File

@ -239,7 +239,7 @@ public:
const char* name() const override { return "ShadowCircularRRectOp"; }
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (int i = 0; i < fGeoData.count(); ++i) {

View File

@ -214,7 +214,7 @@ GrProgramInfo* GrSimpleMeshDrawOpHelper::createProgramInfo(
this->pipelineFlags());
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
static void dump_pipeline_flags(GrPipeline::InputFlags flags, SkString* result) {
if (GrPipeline::InputFlags::kNone != flags) {
if (flags & GrPipeline::InputFlags::kSnapVerticesToPixelCenters) {

View File

@ -114,7 +114,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const;
#endif
GrAAType aaType() const { return static_cast<GrAAType>(fAAType); }

View File

@ -89,7 +89,7 @@ GrProgramInfo* GrSimpleMeshDrawOpHelperWithStencil::createProgramInfoWithStencil
this->stencilSettings());
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString GrSimpleMeshDrawOpHelperWithStencil::dumpInfo() const {
SkString result = INHERITED::dumpInfo();
result.appendf("Stencil settings: %s\n", (fStencilSettings ? "yes" : "no"));

View File

@ -78,7 +78,7 @@ public:
const SkRect& thisBounds, const SkRect& thatBounds,
bool ignoreAAType = false) const;
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const;
#endif

View File

@ -136,7 +136,7 @@ public:
fHelper.visitProxies(func);
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (const auto& geo : fShapes) {

View File

@ -30,7 +30,7 @@ public:
const char* name() const override { return "StencilPathOp"; }
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.printf("Path: 0x%p, AA: %d", fPath.get(), fUseHWAA);

View File

@ -99,7 +99,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.appendf(
@ -428,7 +428,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (const auto& info : fRects) {

View File

@ -276,7 +276,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString str;
str.appendf("# draws: %d\n", fQuads.count());
@ -308,7 +308,9 @@ public:
str += INHERITED::dumpInfo();
return str;
}
#endif
#ifdef SK_DEBUG
static void ValidateResourceLimits() {
// The op implementation has an upper bound on the number of quads that it can represent.
// However, the resource manager imposes its own limit on the number of quads, which should

View File

@ -190,7 +190,7 @@ public:
}
}
#ifdef SK_DEBUG
#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.appendf("Color 0x%08x, aa: %d\n", fColor.toBytes_RGBA(), fAntiAlias);

View File

@ -41,7 +41,7 @@ public:
// returns true if close() has not been called
bool isOpen() const { return fOpen; }
#ifdef SK_DEBUG
#ifdef SK_TRACE_MANAGED_RESOURCES
void dumpInfo() const override {
SkDebugf("GrVkCommandPool: %p (%d refs)\n", fCommandPool, this->getRefCnt());
}