diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp index 4447f31577..1cd00f35d6 100644 --- a/src/gpu/ops/GrAAConvexPathRenderer.cpp +++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp @@ -725,12 +725,8 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { - SkString string; - string.appendf("Count: %d\n", fPaths.count()); - string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); - return string; + SkString onDumpInfo() const override { + return SkStringPrintf("Count: %d\n%s", fPaths.count(), fHelper.dumpInfo().c_str()); } #endif diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp index 138eacd10a..9fa3710eb1 100644 --- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp @@ -857,13 +857,10 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { - SkString string; - string.appendf("Color: 0x%08x Coverage: 0x%02x, Count: %d\n", fColor.toBytes_RGBA(), - fCoverage, fPaths.count()); - string += INHERITED::dumpInfo(); - string += fHelper.dumpInfo(); - return string; + SkString onDumpInfo() const override { + return SkStringPrintf("Color: 0x%08x Coverage: 0x%02x, Count: %d\n%s", + fColor.toBytes_RGBA(), fCoverage, fPaths.count(), + fHelper.dumpInfo().c_str()); } #endif diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp index 7a3738ccfc..6f0acbaf26 100644 --- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp +++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp @@ -187,7 +187,7 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { + SkString onDumpInfo() const override { SkString string; for (const auto& path : fPaths) { string.appendf( @@ -197,7 +197,6 @@ public: path.fMiterLimit); } string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); return string; } #endif diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp index a0265c8b39..4054121785 100644 --- a/src/gpu/ops/GrAtlasTextOp.cpp +++ b/src/gpu/ops/GrAtlasTextOp.cpp @@ -93,7 +93,7 @@ void GrAtlasTextOp::visitProxies(const VisitProxyFunc& func) const { } #if GR_TEST_UTILS -SkString GrAtlasTextOp::dumpInfo() const { +SkString GrAtlasTextOp::onDumpInfo() const { SkString str; for (int i = 0; i < fGeoCount; ++i) { @@ -105,7 +105,6 @@ SkString GrAtlasTextOp::dumpInfo() const { } str += fProcessors.dumpProcessors(); - str += INHERITED::dumpInfo(); return str; } #endif diff --git a/src/gpu/ops/GrAtlasTextOp.h b/src/gpu/ops/GrAtlasTextOp.h index f174af50d6..4fc7182810 100644 --- a/src/gpu/ops/GrAtlasTextOp.h +++ b/src/gpu/ops/GrAtlasTextOp.h @@ -44,7 +44,7 @@ public: void visitProxies(const VisitProxyFunc& func) const override; #if GR_TEST_UTILS - SkString dumpInfo() const override; + SkString onDumpInfo() const override; #endif FixedFunctionFlags fixedFunctionFlags() const override; diff --git a/src/gpu/ops/GrClearOp.h b/src/gpu/ops/GrClearOp.h index bec4d899bb..7c8da2a8d4 100644 --- a/src/gpu/ops/GrClearOp.h +++ b/src/gpu/ops/GrClearOp.h @@ -31,10 +31,8 @@ public: const char* name() const override { return "Clear"; } #if GR_TEST_UTILS - SkString dumpInfo() const override { - SkString string; - string.append(INHERITED::dumpInfo()); - string.appendf("Scissor [ "); + SkString onDumpInfo() const override { + SkString string("Scissor [ "); if (fScissor.enabled()) { const SkIRect& r = fScissor.rect(); string.appendf("L: %d, T: %d, R: %d, B: %d", r.fLeft, r.fTop, r.fRight, r.fBottom); diff --git a/src/gpu/ops/GrDashOp.cpp b/src/gpu/ops/GrDashOp.cpp index 52e531999a..11416d3eca 100644 --- a/src/gpu/ops/GrDashOp.cpp +++ b/src/gpu/ops/GrDashOp.cpp @@ -245,7 +245,7 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { + SkString onDumpInfo() const override { SkString string; for (const auto& geo : fLines) { string.appendf("Pt0: [%.2f, %.2f], Pt1: [%.2f, %.2f], Width: %.2f, Ival0: %.2f, " @@ -258,7 +258,6 @@ public: geo.fPhase); } string += fProcessorSet.dumpProcessors(); - string += INHERITED::dumpInfo(); return string; } #endif diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp index 84e32dde8c..fe87ebae64 100644 --- a/src/gpu/ops/GrDefaultPathRenderer.cpp +++ b/src/gpu/ops/GrDefaultPathRenderer.cpp @@ -370,14 +370,13 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { - SkString string; - string.appendf("Color: 0x%08x Count: %d\n", fColor.toBytes_RGBA(), fPaths.count()); + SkString onDumpInfo() const override { + SkString string = SkStringPrintf("Color: 0x%08x Count: %d\n", + fColor.toBytes_RGBA(), fPaths.count()); for (const auto& path : fPaths) { string.appendf("Tolerance: %.2f\n", path.fTolerance); } string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); return string; } #endif diff --git a/src/gpu/ops/GrDrawAtlasOp.cpp b/src/gpu/ops/GrDrawAtlasOp.cpp index 92a5a922b8..c918d8c387 100644 --- a/src/gpu/ops/GrDrawAtlasOp.cpp +++ b/src/gpu/ops/GrDrawAtlasOp.cpp @@ -45,7 +45,7 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override; + SkString onDumpInfo() const override; #endif FixedFunctionFlags fixedFunctionFlags() const override; @@ -187,14 +187,13 @@ DrawAtlasOp::DrawAtlasOp(const Helper::MakeArgs& helperArgs, const SkPMColor4f& } #if GR_TEST_UTILS -SkString DrawAtlasOp::dumpInfo() const { +SkString DrawAtlasOp::onDumpInfo() const { SkString string; for (const auto& geo : fGeoData) { string.appendf("Color: 0x%08x, Quads: %d\n", geo.fColor.toBytes_RGBA(), geo.fVerts.count() / 4); } string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); return string; } #endif diff --git a/src/gpu/ops/GrDrawPathOp.cpp b/src/gpu/ops/GrDrawPathOp.cpp index e026f4444a..ca1b37b479 100644 --- a/src/gpu/ops/GrDrawPathOp.cpp +++ b/src/gpu/ops/GrDrawPathOp.cpp @@ -38,11 +38,8 @@ GrDrawPathOpBase::GrDrawPathOpBase(uint32_t classID, const SkMatrix& viewMatrix, , fProcessorSet(std::move(paint)) {} #if GR_TEST_UTILS -SkString GrDrawPathOp::dumpInfo() const { - SkString string; - string.printf("PATH: 0x%p", fPath.get()); - string.append(INHERITED::dumpInfo()); - return string; +SkString GrDrawPathOp::onDumpInfo() const { + return SkStringPrintf("PATH: 0x%p", fPath.get()); } #endif diff --git a/src/gpu/ops/GrDrawPathOp.h b/src/gpu/ops/GrDrawPathOp.h index 069b19b41d..38936b8470 100644 --- a/src/gpu/ops/GrDrawPathOp.h +++ b/src/gpu/ops/GrDrawPathOp.h @@ -81,7 +81,7 @@ public: const char* name() const override { return "DrawPath"; } #if GR_TEST_UTILS - SkString dumpInfo() const override; + SkString onDumpInfo() const override; #endif private: diff --git a/src/gpu/ops/GrDrawVerticesOp.cpp b/src/gpu/ops/GrDrawVerticesOp.cpp index 24fe8233c8..eda6a60f8c 100644 --- a/src/gpu/ops/GrDrawVerticesOp.cpp +++ b/src/gpu/ops/GrDrawVerticesOp.cpp @@ -456,7 +456,7 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override; + SkString onDumpInfo() const override; #endif FixedFunctionFlags fixedFunctionFlags() const override; @@ -582,13 +582,10 @@ DrawVerticesOp::DrawVerticesOp(const Helper::MakeArgs& helperArgs, } #if GR_TEST_UTILS -SkString DrawVerticesOp::dumpInfo() const { - SkString string; - string.appendf("PrimType: %d, MeshCount %d, VCount: %d, ICount: %d\n", (int)fPrimitiveType, - fMeshes.count(), fVertexCount, fIndexCount); - string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); - return string; +SkString DrawVerticesOp::onDumpInfo() const { + return SkStringPrintf("PrimType: %d, MeshCount %d, VCount: %d, ICount: %d\n%s", + (int)fPrimitiveType, fMeshes.count(), fVertexCount, fIndexCount, + fHelper.dumpInfo().c_str()); } #endif diff --git a/src/gpu/ops/GrDrawableOp.h b/src/gpu/ops/GrDrawableOp.h index 3c0c874f6d..646e6475cc 100644 --- a/src/gpu/ops/GrDrawableOp.h +++ b/src/gpu/ops/GrDrawableOp.h @@ -26,12 +26,6 @@ public: const char* name() const override { return "Drawable"; } -#if GR_TEST_UTILS - SkString dumpInfo() const override { - return INHERITED::dumpInfo(); - } -#endif - private: friend class GrOpMemoryPool; // for ctor diff --git a/src/gpu/ops/GrFillRectOp.cpp b/src/gpu/ops/GrFillRectOp.cpp index 28322f5abc..d46df4559e 100644 --- a/src/gpu/ops/GrFillRectOp.cpp +++ b/src/gpu/ops/GrFillRectOp.cpp @@ -121,9 +121,8 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { - SkString str; - str.appendf("# draws: %u\n", fQuads.count()); + SkString onDumpInfo() const override { + SkString str = SkStringPrintf("# draws: %u\n", fQuads.count()); str.appendf("Device quad type: %u, local quad type: %u\n", (uint32_t) fQuads.deviceQuadType(), (uint32_t) fQuads.localQuadType()); str += fHelper.dumpInfo(); @@ -135,7 +134,6 @@ public: info.fColor, info.fAAFlags); i++; } - str += INHERITED::dumpInfo(); return str; } #endif diff --git a/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp index 59cf2c090c..f09d6228ec 100644 --- a/src/gpu/ops/GrLatticeOp.cpp +++ b/src/gpu/ops/GrLatticeOp.cpp @@ -174,7 +174,7 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { + SkString onDumpInfo() const override { SkString str; for (int i = 0; i < fPatches.count(); ++i) { @@ -184,7 +184,6 @@ public: } str += fHelper.dumpInfo(); - str += INHERITED::dumpInfo(); return str; } #endif diff --git a/src/gpu/ops/GrOp.h b/src/gpu/ops/GrOp.h index 35c4f8c4d5..fac22aef29 100644 --- a/src/gpu/ops/GrOp.h +++ b/src/gpu/ops/GrOp.h @@ -181,11 +181,11 @@ public: /** Used for spewing information about ops when debugging. */ #if GR_TEST_UTILS - virtual SkString dumpInfo() const { - SkString string; - string.appendf("OpBounds: [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", - fBounds.fLeft, fBounds.fTop, fBounds.fRight, fBounds.fBottom); - return string; + virtual SkString onDumpInfo() const { return SkString(); } + virtual SkString dumpInfo() const final { + return SkStringPrintf("%s\nOpBounds: [L: %.2f, T: %.2f, R: %.2f, B: %.2f]", + this->onDumpInfo().c_str(), fBounds.fLeft, fBounds.fTop, + fBounds.fRight, fBounds.fBottom); } #endif diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp index 537aa823ce..7d382e817d 100644 --- a/src/gpu/ops/GrOvalOpFactory.cpp +++ b/src/gpu/ops/GrOvalOpFactory.cpp @@ -1227,7 +1227,7 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { + SkString onDumpInfo() const override { SkString string; for (int i = 0; i < fCircles.count(); ++i) { string.appendf( @@ -1239,7 +1239,6 @@ public: fCircles[i].fOuterRadius); } string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); return string; } #endif @@ -1589,7 +1588,7 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { + SkString onDumpInfo() const override { SkString string; for (int i = 0; i < fCircles.count(); ++i) { string.appendf( @@ -1603,7 +1602,6 @@ public: fCircles[i].fPhaseAngle); } string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); return string; } #endif @@ -1920,9 +1918,8 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { - SkString string; - string.appendf("Stroked: %d\n", fStroked); + SkString onDumpInfo() const override { + SkString string = SkStringPrintf("Stroked: %d\n", fStroked); for (const auto& geo : fEllipses) { string.appendf( "Color: 0x%08x Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], " @@ -1932,7 +1929,6 @@ public: geo.fInnerXRadius, geo.fInnerYRadius); } string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); return string; } #endif @@ -2197,7 +2193,7 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { + SkString onDumpInfo() const override { SkString string; for (const auto& geo : fEllipses) { string.appendf( @@ -2209,7 +2205,6 @@ public: geo.fInnerXRadius, geo.fInnerYRadius, geo.fGeoDx, geo.fGeoDy); } string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); return string; } #endif @@ -2547,7 +2542,7 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { + SkString onDumpInfo() const override { SkString string; for (int i = 0; i < fRRects.count(); ++i) { string.appendf( @@ -2559,7 +2554,6 @@ public: fRRects[i].fOuterRadius); } string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); return string; } #endif @@ -2919,9 +2913,8 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { - SkString string; - string.appendf("Stroked: %d\n", fStroked); + SkString onDumpInfo() const override { + SkString string = SkStringPrintf("Stroked: %d\n", fStroked); for (const auto& geo : fRRects) { string.appendf( "Color: 0x%08x Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], " @@ -2931,7 +2924,6 @@ public: geo.fInnerXRadius, geo.fInnerYRadius); } string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); return string; } #endif diff --git a/src/gpu/ops/GrRegionOp.cpp b/src/gpu/ops/GrRegionOp.cpp index 8d6676237f..6a3818a9dc 100644 --- a/src/gpu/ops/GrRegionOp.cpp +++ b/src/gpu/ops/GrRegionOp.cpp @@ -73,16 +73,14 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { - SkString str; - str.appendf("# combined: %d\n", fRegions.count()); + SkString onDumpInfo() const override { + SkString str = SkStringPrintf("# combined: %d\n", fRegions.count()); for (int i = 0; i < fRegions.count(); ++i) { const RegionInfo& info = fRegions[i]; str.appendf("%d: Color: 0x%08x, Region with %d rects\n", i, info.fColor.toBytes_RGBA(), info.fRegion.computeRegionComplexity()); } str += fHelper.dumpInfo(); - str += INHERITED::dumpInfo(); return str; } #endif diff --git a/src/gpu/ops/GrShadowRRectOp.cpp b/src/gpu/ops/GrShadowRRectOp.cpp index 02370936b5..fd1e31532f 100644 --- a/src/gpu/ops/GrShadowRRectOp.cpp +++ b/src/gpu/ops/GrShadowRRectOp.cpp @@ -240,7 +240,7 @@ public: const char* name() const override { return "ShadowCircularRRectOp"; } #if GR_TEST_UTILS - SkString dumpInfo() const override { + SkString onDumpInfo() const override { SkString string; for (int i = 0; i < fGeoData.count(); ++i) { string.appendf( @@ -251,7 +251,6 @@ public: fGeoData[i].fOuterRadius, fGeoData[i].fUmbraInset, fGeoData[i].fInnerRadius, fGeoData[i].fBlurRadius); } - string.append(INHERITED::dumpInfo()); return string; } #endif diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp index cdbc5b44ea..5762eb72e0 100644 --- a/src/gpu/ops/GrSmallPathRenderer.cpp +++ b/src/gpu/ops/GrSmallPathRenderer.cpp @@ -137,13 +137,12 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { + SkString onDumpInfo() const override { SkString string; for (const auto& geo : fShapes) { string.appendf("Color: 0x%08x\n", geo.fColor.toBytes_RGBA()); } string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); return string; } #endif diff --git a/src/gpu/ops/GrStencilPathOp.h b/src/gpu/ops/GrStencilPathOp.h index 33cebd352b..073c0220c5 100644 --- a/src/gpu/ops/GrStencilPathOp.h +++ b/src/gpu/ops/GrStencilPathOp.h @@ -31,11 +31,8 @@ public: const char* name() const override { return "StencilPathOp"; } #if GR_TEST_UTILS - SkString dumpInfo() const override { - SkString string; - string.printf("Path: 0x%p, AA: %d", fPath.get(), fUseHWAA); - string.append(INHERITED::dumpInfo()); - return string; + SkString onDumpInfo() const override { + return SkStringPrintf("Path: 0x%p, AA: %d", fPath.get(), fUseHWAA); } #endif diff --git a/src/gpu/ops/GrStrokeRectOp.cpp b/src/gpu/ops/GrStrokeRectOp.cpp index 28d5a9b6b7..1a42e0ff5b 100644 --- a/src/gpu/ops/GrStrokeRectOp.cpp +++ b/src/gpu/ops/GrStrokeRectOp.cpp @@ -100,16 +100,11 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { - SkString string; - string.appendf( - "Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], " - "StrokeWidth: %.2f\n", - fColor.toBytes_RGBA(), fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom, - fStrokeWidth); - string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); - return string; + SkString onDumpInfo() const override { + return SkStringPrintf("Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], " + "StrokeWidth: %.2f\n%s", + fColor.toBytes_RGBA(), fRect.fLeft, fRect.fTop, fRect.fRight, + fRect.fBottom, fStrokeWidth, fHelper.dumpInfo().c_str()); } #endif @@ -429,7 +424,7 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { + SkString onDumpInfo() const override { SkString string; for (const auto& info : fRects) { string.appendf( @@ -443,7 +438,6 @@ public: info.fDevInside.fRight, info.fDevInside.fBottom, info.fDegenerate); } string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); return string; } #endif diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp index 982f898586..59f34abfa7 100644 --- a/src/gpu/ops/GrTextureOp.cpp +++ b/src/gpu/ops/GrTextureOp.cpp @@ -277,9 +277,8 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { - SkString str; - str.appendf("# draws: %d\n", fQuads.count()); + SkString onDumpInfo() const override { + SkString str = SkStringPrintf("# draws: %d\n", fQuads.count()); auto iter = fQuads.iterator(); for (unsigned p = 0; p < fMetadata.fProxyCount; ++p) { str.appendf("Proxy ID: %d, Filter: %d, MM: %d\n", @@ -305,7 +304,6 @@ public: i++; } } - str += INHERITED::dumpInfo(); return str; } #endif diff --git a/src/gpu/ops/GrTriangulatingPathRenderer.cpp b/src/gpu/ops/GrTriangulatingPathRenderer.cpp index 15baa4543d..f0a2a451c6 100644 --- a/src/gpu/ops/GrTriangulatingPathRenderer.cpp +++ b/src/gpu/ops/GrTriangulatingPathRenderer.cpp @@ -191,12 +191,9 @@ public: } #if GR_TEST_UTILS - SkString dumpInfo() const override { - SkString string; - string.appendf("Color 0x%08x, aa: %d\n", fColor.toBytes_RGBA(), fAntiAlias); - string += fHelper.dumpInfo(); - string += INHERITED::dumpInfo(); - return string; + SkString onDumpInfo() const override { + return SkStringPrintf("Color 0x%08x, aa: %d\n%s", + fColor.toBytes_RGBA(), fAntiAlias, fHelper.dumpInfo().c_str()); } #endif