Reland "Guard dumpInfo() calls with GR_TEST_UTILS, instead of SK_DEBUG."
and
"Guard gencode dumpInfo() calls with GR_TEST_UTILS, instead of SK_DEBUG"
and
"Remove dumpInfo() entirely when GR_TEST_UTILS is off."
This is a reland of 26900788ef64db9bd53ea44827d820488842f07d
and b5e8a2533aed66710492da7ce0fa07a0fd6bf047
and d7b09c4c3acf69a3fea49f5baaa8b5bed954a6fc
and unit tests are now fixed.
Original change's description:
> 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>
Change-Id: I16e6606082a814b4fa5ef58d1096fc915f5ac704
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309721
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp
index 5fe5792..4447f31 100644
--- a/src/gpu/ops/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp
@@ -724,7 +724,7 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.appendf("Count: %d\n", fPaths.count());
diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
index afe7105..138eacd 100644
--- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
@@ -856,7 +856,7 @@
}
}
-#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(),
diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
index fdd4162..7a3738c 100644
--- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
@@ -186,7 +186,7 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (const auto& path : fPaths) {
diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp
index 90e6fa9..a0265c8 100644
--- a/src/gpu/ops/GrAtlasTextOp.cpp
+++ b/src/gpu/ops/GrAtlasTextOp.cpp
@@ -92,7 +92,7 @@
fProcessors.visitProxies(func);
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString GrAtlasTextOp::dumpInfo() const {
SkString str;
diff --git a/src/gpu/ops/GrAtlasTextOp.h b/src/gpu/ops/GrAtlasTextOp.h
index c275eb1..f174af5 100644
--- a/src/gpu/ops/GrAtlasTextOp.h
+++ b/src/gpu/ops/GrAtlasTextOp.h
@@ -43,7 +43,7 @@
void visitProxies(const VisitProxyFunc& func) const override;
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override;
#endif
diff --git a/src/gpu/ops/GrClearOp.h b/src/gpu/ops/GrClearOp.h
index 5eaff4b..bec4d89 100644
--- a/src/gpu/ops/GrClearOp.h
+++ b/src/gpu/ops/GrClearOp.h
@@ -30,7 +30,7 @@
const char* name() const override { return "Clear"; }
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.append(INHERITED::dumpInfo());
diff --git a/src/gpu/ops/GrDashOp.cpp b/src/gpu/ops/GrDashOp.cpp
index ce27d28..52e5319 100644
--- a/src/gpu/ops/GrDashOp.cpp
+++ b/src/gpu/ops/GrDashOp.cpp
@@ -244,7 +244,7 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (const auto& geo : fLines) {
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index d711fdb..84e32dd 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -369,7 +369,7 @@
}
}
-#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());
diff --git a/src/gpu/ops/GrDrawAtlasOp.cpp b/src/gpu/ops/GrDrawAtlasOp.cpp
index 3248d41..92a5a92 100644
--- a/src/gpu/ops/GrDrawAtlasOp.cpp
+++ b/src/gpu/ops/GrDrawAtlasOp.cpp
@@ -44,7 +44,7 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override;
#endif
@@ -186,7 +186,7 @@
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) {
diff --git a/src/gpu/ops/GrDrawPathOp.cpp b/src/gpu/ops/GrDrawPathOp.cpp
index 3a60b6d..e026f44 100644
--- a/src/gpu/ops/GrDrawPathOp.cpp
+++ b/src/gpu/ops/GrDrawPathOp.cpp
@@ -37,7 +37,7 @@
, 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());
diff --git a/src/gpu/ops/GrDrawPathOp.h b/src/gpu/ops/GrDrawPathOp.h
index d7f2cc2..069b19b 100644
--- a/src/gpu/ops/GrDrawPathOp.h
+++ b/src/gpu/ops/GrDrawPathOp.h
@@ -80,7 +80,7 @@
const char* name() const override { return "DrawPath"; }
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override;
#endif
diff --git a/src/gpu/ops/GrDrawVerticesOp.cpp b/src/gpu/ops/GrDrawVerticesOp.cpp
index ea678a2..24fe823 100644
--- a/src/gpu/ops/GrDrawVerticesOp.cpp
+++ b/src/gpu/ops/GrDrawVerticesOp.cpp
@@ -455,7 +455,7 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override;
#endif
@@ -581,7 +581,7 @@
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,
diff --git a/src/gpu/ops/GrDrawableOp.h b/src/gpu/ops/GrDrawableOp.h
index 6c0debe..3c0c874 100644
--- a/src/gpu/ops/GrDrawableOp.h
+++ b/src/gpu/ops/GrDrawableOp.h
@@ -26,7 +26,7 @@
const char* name() const override { return "Drawable"; }
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
return INHERITED::dumpInfo();
}
diff --git a/src/gpu/ops/GrFillRectOp.cpp b/src/gpu/ops/GrFillRectOp.cpp
index 23f5d3a..28322f5 100644
--- a/src/gpu/ops/GrFillRectOp.cpp
+++ b/src/gpu/ops/GrFillRectOp.cpp
@@ -29,7 +29,7 @@
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 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString str;
str.appendf("# draws: %u\n", fQuads.count());
diff --git a/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp
index e09de27..59cf2c0 100644
--- a/src/gpu/ops/GrLatticeOp.cpp
+++ b/src/gpu/ops/GrLatticeOp.cpp
@@ -173,7 +173,7 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString str;
diff --git a/src/gpu/ops/GrOp.h b/src/gpu/ops/GrOp.h
index 83bf527..fa5472a 100644
--- a/src/gpu/ops/GrOp.h
+++ b/src/gpu/ops/GrOp.h
@@ -180,7 +180,7 @@
}
/** 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",
diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp
index b40fcb0..537aa82 100644
--- a/src/gpu/ops/GrOvalOpFactory.cpp
+++ b/src/gpu/ops/GrOvalOpFactory.cpp
@@ -1226,7 +1226,7 @@
}
}
-#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 @@
}
}
-#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 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.appendf("Stroked: %d\n", fStroked);
@@ -2196,7 +2196,7 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (const auto& geo : fEllipses) {
@@ -2546,7 +2546,7 @@
}
}
-#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 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.appendf("Stroked: %d\n", fStroked);
diff --git a/src/gpu/ops/GrRegionOp.cpp b/src/gpu/ops/GrRegionOp.cpp
index f9c1885..8d66762 100644
--- a/src/gpu/ops/GrRegionOp.cpp
+++ b/src/gpu/ops/GrRegionOp.cpp
@@ -72,7 +72,7 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString str;
str.appendf("# combined: %d\n", fRegions.count());
diff --git a/src/gpu/ops/GrShadowRRectOp.cpp b/src/gpu/ops/GrShadowRRectOp.cpp
index 144e81b..0237093 100644
--- a/src/gpu/ops/GrShadowRRectOp.cpp
+++ b/src/gpu/ops/GrShadowRRectOp.cpp
@@ -239,7 +239,7 @@
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) {
diff --git a/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp b/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp
index 86dbc33..ae689e5 100644
--- a/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp
+++ b/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp
@@ -214,7 +214,7 @@
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) {
diff --git a/src/gpu/ops/GrSimpleMeshDrawOpHelper.h b/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
index 0f9e46a..231e078 100644
--- a/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
+++ b/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
@@ -114,7 +114,7 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const;
#endif
GrAAType aaType() const { return static_cast<GrAAType>(fAAType); }
diff --git a/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.cpp b/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.cpp
index 1af6bdb..202f2e5 100644
--- a/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.cpp
+++ b/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.cpp
@@ -89,7 +89,7 @@
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"));
diff --git a/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h b/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h
index e76693a..9eb8b68 100644
--- a/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h
+++ b/src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h
@@ -78,7 +78,7 @@
const SkRect& thisBounds, const SkRect& thatBounds,
bool ignoreAAType = false) const;
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const;
#endif
diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp
index 95b40c6..cdbc5b4 100644
--- a/src/gpu/ops/GrSmallPathRenderer.cpp
+++ b/src/gpu/ops/GrSmallPathRenderer.cpp
@@ -136,7 +136,7 @@
fHelper.visitProxies(func);
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (const auto& geo : fShapes) {
diff --git a/src/gpu/ops/GrStencilPathOp.h b/src/gpu/ops/GrStencilPathOp.h
index a3c9198..33cebd3 100644
--- a/src/gpu/ops/GrStencilPathOp.h
+++ b/src/gpu/ops/GrStencilPathOp.h
@@ -30,7 +30,7 @@
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);
diff --git a/src/gpu/ops/GrStrokeRectOp.cpp b/src/gpu/ops/GrStrokeRectOp.cpp
index 7bbfc0f..28d5a9b 100644
--- a/src/gpu/ops/GrStrokeRectOp.cpp
+++ b/src/gpu/ops/GrStrokeRectOp.cpp
@@ -99,7 +99,7 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
string.appendf(
@@ -428,7 +428,7 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString string;
for (const auto& info : fRects) {
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp
index f43c9b1..982f898 100644
--- a/src/gpu/ops/GrTextureOp.cpp
+++ b/src/gpu/ops/GrTextureOp.cpp
@@ -276,7 +276,7 @@
}
}
-#ifdef SK_DEBUG
+#if GR_TEST_UTILS
SkString dumpInfo() const override {
SkString str;
str.appendf("# draws: %d\n", fQuads.count());
@@ -308,7 +308,9 @@
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
diff --git a/src/gpu/ops/GrTriangulatingPathRenderer.cpp b/src/gpu/ops/GrTriangulatingPathRenderer.cpp
index 64429f0..15baa45 100644
--- a/src/gpu/ops/GrTriangulatingPathRenderer.cpp
+++ b/src/gpu/ops/GrTriangulatingPathRenderer.cpp
@@ -190,7 +190,7 @@
}
}
-#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);