From 7c3e7180948766321c51d165737555e78910de51 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Thu, 1 Dec 2016 09:35:30 -0500 Subject: [PATCH] Remove pipeline info dump from GrDrawBatch Also adds more overrides of GrBatch::dumpInfo. This removes a use case of the GrPipeline member of GrDrawBatch. Change-Id: I93f5f2993be41ffa290122f12a683d2bac453e1d Reviewed-on: https://skia-review.googlesource.com/5354 Reviewed-by: Greg Daniel Commit-Queue: Brian Salomon --- src/gpu/GrOvalRenderer.cpp | 61 +++++++++++++++++++ src/gpu/batches/GrAAConvexPathRenderer.cpp | 10 +++ .../batches/GrAADistanceFieldPathRenderer.cpp | 10 +++ src/gpu/batches/GrAAFillRectBatch.cpp | 1 + src/gpu/batches/GrAAHairLinePathRenderer.cpp | 10 +++ .../GrAALinearizingConvexPathRenderer.cpp | 14 ++++- src/gpu/batches/GrAAStrokeRectBatch.cpp | 20 ++++++ src/gpu/batches/GrAnalyticRectBatch.cpp | 1 + src/gpu/batches/GrAtlasTextBatch.cpp | 1 + src/gpu/batches/GrDefaultPathRenderer.cpp | 10 +++ src/gpu/batches/GrDrawAtlasBatch.h | 10 +++ src/gpu/batches/GrDrawBatch.h | 32 +++++----- src/gpu/batches/GrDrawPathBatch.cpp | 2 + src/gpu/batches/GrDrawVerticesBatch.h | 9 +++ src/gpu/batches/GrMSAAPathRenderer.cpp | 11 ++++ src/gpu/batches/GrNinePatch.cpp | 1 + src/gpu/batches/GrNonAAFillRectBatch.cpp | 1 + .../GrNonAAFillRectPerspectiveBatch.cpp | 1 + src/gpu/batches/GrNonAAStrokeRectBatch.cpp | 11 ++++ src/gpu/batches/GrPLSPathRenderer.cpp | 11 +++- src/gpu/batches/GrRegionBatch.cpp | 1 + src/gpu/batches/GrShadowRRectBatch.cpp | 2 + .../batches/GrTessellatingPathRenderer.cpp | 8 +++ src/gpu/effects/GrDashingEffect.cpp | 17 ++++++ src/gpu/instanced/InstancedRendering.h | 19 ++++++ 25 files changed, 254 insertions(+), 20 deletions(-) diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp index fd1d30bd84..ea126b1262 100644 --- a/src/gpu/GrOvalRenderer.cpp +++ b/src/gpu/GrOvalRenderer.cpp @@ -791,6 +791,7 @@ public: fGeoData[i].fInnerRadius, fGeoData[i].fOuterRadius); } + string.append(DumpPipelineInfo(*this->pipeline())); string.append(INHERITED::dumpInfo()); return string; } @@ -1231,6 +1232,25 @@ public: const char* name() const override { return "EllipseBatch"; } + SkString dumpInfo() const override { + SkString string; + string.appendf("Stroked: %d\n", fStroked); + for (const auto& geo : fGeoData) { + string.appendf("Color: 0x%08x Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], " + "XRad: %.2f, YRad: %.2f, InnerXRad: %.2f, InnerYRad: %.2f\n", + geo.fColor, + geo.fDevBounds.fLeft, geo.fDevBounds.fTop, + geo.fDevBounds.fRight, geo.fDevBounds.fBottom, + geo.fXRadius, + geo.fYRadius, + geo.fInnerXRadius, + geo.fInnerYRadius); + } + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { @@ -1443,6 +1463,27 @@ public: const char* name() const override { return "DIEllipseBatch"; } + SkString dumpInfo() const override { + SkString string; + for (const auto& geo : fGeoData) { + string.appendf("Color: 0x%08x Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], XRad: %.2f, " + "YRad: %.2f, InnerXRad: %.2f, InnerYRad: %.2f, GeoDX: %.2f, " + "GeoDY: %.2f\n", + geo.fColor, + geo.fBounds.fLeft, geo.fBounds.fTop, + geo.fBounds.fRight, geo.fBounds.fBottom, + geo.fXRadius, + geo.fYRadius, + geo.fInnerXRadius, + geo.fInnerYRadius, + geo.fGeoDx, + geo.fGeoDy); + } + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { @@ -1754,6 +1795,7 @@ public: fGeoData[i].fInnerRadius, fGeoData[i].fOuterRadius); } + string.append(DumpPipelineInfo(*this->pipeline())); string.append(INHERITED::dumpInfo()); return string; } @@ -2104,6 +2146,25 @@ public: const char* name() const override { return "RRectEllipseRendererBatch"; } + SkString dumpInfo() const override { + SkString string; + string.appendf("Stroked: %d\n", fStroked); + for (const auto& geo : fGeoData) { + string.appendf("Color: 0x%08x Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], " + "XRad: %.2f, YRad: %.2f, InnerXRad: %.2f, InnerYRad: %.2f\n", + geo.fColor, + geo.fDevBounds.fLeft, geo.fDevBounds.fTop, + geo.fDevBounds.fRight, geo.fDevBounds.fBottom, + geo.fXRadius, + geo.fYRadius, + geo.fInnerXRadius, + geo.fInnerYRadius); + } + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { diff --git a/src/gpu/batches/GrAAConvexPathRenderer.cpp b/src/gpu/batches/GrAAConvexPathRenderer.cpp index bec774c281..1be84c7ca0 100644 --- a/src/gpu/batches/GrAAConvexPathRenderer.cpp +++ b/src/gpu/batches/GrAAConvexPathRenderer.cpp @@ -744,6 +744,16 @@ public: const char* name() const override { return "AAConvexBatch"; } + SkString dumpInfo() const override { + SkString string; + for (const auto& geo : fGeoData) { + string.appendf("Color: 0x%08x\n", geo.fColor); + } + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp index 9f4274ddee..e91192733c 100644 --- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp +++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp @@ -154,6 +154,16 @@ public: const char* name() const override { return "AADistanceFieldPathBatch"; } + SkString dumpInfo() const override { + SkString string; + for (const auto& geo : fGeoData) { + string.appendf("Color: 0x%08x AA:%d\n", geo.fColor, geo.fAntiAlias); + } + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp index fd2a4c4843..46a5d50955 100644 --- a/src/gpu/batches/GrAAFillRectBatch.cpp +++ b/src/gpu/batches/GrAAFillRectBatch.cpp @@ -191,6 +191,7 @@ public: i, info->color(), rect.fLeft, rect.fTop, rect.fRight, rect.fBottom); info = this->next(info); } + str.append(DumpPipelineInfo(*this->pipeline())); str.append(INHERITED::dumpInfo()); return str; } diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp index 70c491111f..b2ad9ba28e 100644 --- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp @@ -692,6 +692,16 @@ public: const char* name() const override { return "AAHairlineBatch"; } + SkString dumpInfo() const override { + SkString string; + for (const auto& geo : fGeoData) { + string.appendf("Color: 0x%08x Coverage: 0x%02x\n", geo.fColor, geo.fCoverage); + } + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp index d53fe9c6cd..f8516b9df2 100644 --- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp +++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp @@ -151,7 +151,19 @@ public: this->setTransformedBounds(bounds, viewMatrix, HasAABloat::kYes, IsZeroArea::kNo); } - const char* name() const override { return "AAConvexBatch"; } + const char* name() const override { return "AAFlatteningConvexBatch"; } + + SkString dumpInfo() const override { + SkString string; + for (const auto& geo : fGeoData) { + string.appendf("Color: 0x%08x, StrokeWidth: %.2f, Style: %d, Join: %d, " + "MiterLimit: %.2f\n", + geo.fColor, geo.fStrokeWidth, geo.fStyle, geo.fJoin, geo.fMiterLimit); + } + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, diff --git a/src/gpu/batches/GrAAStrokeRectBatch.cpp b/src/gpu/batches/GrAAStrokeRectBatch.cpp index f3c512dcca..7f87ad6222 100644 --- a/src/gpu/batches/GrAAStrokeRectBatch.cpp +++ b/src/gpu/batches/GrAAStrokeRectBatch.cpp @@ -152,6 +152,26 @@ public: const char* name() const override { return "AAStrokeRect"; } + SkString dumpInfo() const override { + SkString string; + for (const auto& geo : fGeoData) { + string.appendf("Color: 0x%08x, ORect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], " + "AssistORect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], " + "IRect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], Degen: %d", + geo.fColor, + geo.fDevOutside.fLeft, geo.fDevOutside.fTop, + geo.fDevOutside.fRight, geo.fDevOutside.fBottom, + geo.fDevOutsideAssist.fLeft, geo.fDevOutsideAssist.fTop, + geo.fDevOutsideAssist.fRight, geo.fDevOutsideAssist.fBottom, + geo.fDevInside.fLeft, geo.fDevInside.fTop, + geo.fDevInside.fRight, geo.fDevInside.fBottom, + geo.fDegenerate); + } + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { diff --git a/src/gpu/batches/GrAnalyticRectBatch.cpp b/src/gpu/batches/GrAnalyticRectBatch.cpp index fb343df602..655644f048 100644 --- a/src/gpu/batches/GrAnalyticRectBatch.cpp +++ b/src/gpu/batches/GrAnalyticRectBatch.cpp @@ -270,6 +270,7 @@ public: fGeoData[i].fHalfWidth, fGeoData[i].fHalfHeight); } + string.append(DumpPipelineInfo(*this->pipeline())); string.append(INHERITED::dumpInfo()); return string; } diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp index fe5c3b92e6..cf4ca24aa8 100644 --- a/src/gpu/batches/GrAtlasTextBatch.cpp +++ b/src/gpu/batches/GrAtlasTextBatch.cpp @@ -40,6 +40,7 @@ SkString GrAtlasTextBatch::dumpInfo() const { fGeoData[i].fBlob->runCount()); } + str.append(DumpPipelineInfo(*this->pipeline())); str.append(INHERITED::dumpInfo()); return str; } diff --git a/src/gpu/batches/GrDefaultPathRenderer.cpp b/src/gpu/batches/GrDefaultPathRenderer.cpp index 2fbc90b102..21e2289df3 100644 --- a/src/gpu/batches/GrDefaultPathRenderer.cpp +++ b/src/gpu/batches/GrDefaultPathRenderer.cpp @@ -113,6 +113,16 @@ public: const char* name() const override { return "DefaultPathBatch"; } + SkString dumpInfo() const override { + SkString string; + for (const auto& geo : fGeoData) { + string.appendf("Color: 0x%08x Tolerance: %.2f\n", geo.fColor, geo.fTolerance); + } + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { diff --git a/src/gpu/batches/GrDrawAtlasBatch.h b/src/gpu/batches/GrDrawAtlasBatch.h index d9adf22a60..f8d88e0c20 100644 --- a/src/gpu/batches/GrDrawAtlasBatch.h +++ b/src/gpu/batches/GrDrawAtlasBatch.h @@ -21,6 +21,16 @@ public: const char* name() const override { return "DrawAtlasBatch"; } + SkString dumpInfo() const override { + SkString string; + for (const auto& geo : fGeoData) { + string.appendf("Color: 0x%08x, Quads: %d\n", geo.fColor, geo.fVerts.count() / 4); + } + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { diff --git a/src/gpu/batches/GrDrawBatch.h b/src/gpu/batches/GrDrawBatch.h index 95516c9363..c92dca346a 100644 --- a/src/gpu/batches/GrDrawBatch.h +++ b/src/gpu/batches/GrDrawBatch.h @@ -75,40 +75,38 @@ public: return this->pipeline()->getRenderTarget()->uniqueID(); } - SkString dumpInfo() const override { +protected: + static SkString DumpPipelineInfo(const GrPipeline& pipeline) { SkString string; - string.appendf("RT: %d\n", this->renderTargetUniqueID().asUInt()); + string.appendf("RT: %d\n", pipeline.getRenderTarget()->uniqueID().asUInt()); string.append("ColorStages:\n"); - for (int i = 0; i < this->pipeline()->numColorFragmentProcessors(); i++) { + for (int i = 0; i < pipeline.numColorFragmentProcessors(); i++) { string.appendf("\t\t%s\n\t\t%s\n", - this->pipeline()->getColorFragmentProcessor(i).name(), - this->pipeline()->getColorFragmentProcessor(i).dumpInfo().c_str()); + pipeline.getColorFragmentProcessor(i).name(), + pipeline.getColorFragmentProcessor(i).dumpInfo().c_str()); } string.append("CoverageStages:\n"); - for (int i = 0; i < this->pipeline()->numCoverageFragmentProcessors(); i++) { + for (int i = 0; i < pipeline.numCoverageFragmentProcessors(); i++) { string.appendf("\t\t%s\n\t\t%s\n", - this->pipeline()->getCoverageFragmentProcessor(i).name(), - this->pipeline()->getCoverageFragmentProcessor(i).dumpInfo().c_str()); + pipeline.getCoverageFragmentProcessor(i).name(), + pipeline.getCoverageFragmentProcessor(i).dumpInfo().c_str()); } - string.appendf("XP: %s\n", this->pipeline()->getXferProcessor().name()); + string.appendf("XP: %s\n", pipeline.getXferProcessor().name()); - bool scissorEnabled = this->pipeline()->getScissorState().enabled(); + bool scissorEnabled = pipeline.getScissorState().enabled(); string.appendf("Scissor: "); if (scissorEnabled) { string.appendf("[L: %d, T: %d, R: %d, B: %d]\n", - this->pipeline()->getScissorState().rect().fLeft, - this->pipeline()->getScissorState().rect().fTop, - this->pipeline()->getScissorState().rect().fRight, - this->pipeline()->getScissorState().rect().fBottom); + pipeline.getScissorState().rect().fLeft, + pipeline.getScissorState().rect().fTop, + pipeline.getScissorState().rect().fRight, + pipeline.getScissorState().rect().fBottom); } else { string.appendf("\n"); } - string.append(INHERITED::dumpInfo()); - return string; } -protected: const GrPipeline* pipeline() const { SkASSERT(fPipelineInstalled); return reinterpret_cast(fPipelineStorage.get()); diff --git a/src/gpu/batches/GrDrawPathBatch.cpp b/src/gpu/batches/GrDrawPathBatch.cpp index 6522fb5da0..fb458ec7cc 100644 --- a/src/gpu/batches/GrDrawPathBatch.cpp +++ b/src/gpu/batches/GrDrawPathBatch.cpp @@ -22,6 +22,7 @@ void GrDrawPathBatchBase::onPrepare(GrBatchFlushState*) { SkString GrDrawPathBatch::dumpInfo() const { SkString string; string.printf("PATH: 0x%p", fPath.get()); + string.append(DumpPipelineInfo(*this->pipeline())); string.append(INHERITED::dumpInfo()); return string; } @@ -44,6 +45,7 @@ SkString GrDrawPathRangeBatch::dumpInfo() const { } string.remove(string.size() - 2, 2); string.append("]"); + string.append(DumpPipelineInfo(*this->pipeline())); string.append(INHERITED::dumpInfo()); return string; } diff --git a/src/gpu/batches/GrDrawVerticesBatch.h b/src/gpu/batches/GrDrawVerticesBatch.h index 9665c1a905..d71fb0daba 100644 --- a/src/gpu/batches/GrDrawVerticesBatch.h +++ b/src/gpu/batches/GrDrawVerticesBatch.h @@ -31,6 +31,15 @@ public: const char* name() const override { return "DrawVerticesBatch"; } + SkString dumpInfo() const override { + SkString string; + string.appendf("PrimType: %d, VarColor: %d, VCount: %d, ICount: %d\n", + fPrimitiveType, fVariableColor, fVertexCount, fIndexCount); + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override; diff --git a/src/gpu/batches/GrMSAAPathRenderer.cpp b/src/gpu/batches/GrMSAAPathRenderer.cpp index a1fc635c61..ab98a15055 100644 --- a/src/gpu/batches/GrMSAAPathRenderer.cpp +++ b/src/gpu/batches/GrMSAAPathRenderer.cpp @@ -233,6 +233,17 @@ public: const char* name() const override { return "MSAAPathBatch"; } + SkString dumpInfo() const override { + SkString string; + string.appendf("Indexed: %d\n", fIsIndexed); + for (const auto& path : fPaths) { + string.appendf("Color: 0x%08x\n", path.fColor); + } + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { diff --git a/src/gpu/batches/GrNinePatch.cpp b/src/gpu/batches/GrNinePatch.cpp index 5e0be737ae..2e1809d754 100644 --- a/src/gpu/batches/GrNinePatch.cpp +++ b/src/gpu/batches/GrNinePatch.cpp @@ -59,6 +59,7 @@ public: fPatches[i].fDst.fRight, fPatches[i].fDst.fBottom); } + str.append(DumpPipelineInfo(*this->pipeline())); str.append(INHERITED::dumpInfo()); return str; } diff --git a/src/gpu/batches/GrNonAAFillRectBatch.cpp b/src/gpu/batches/GrNonAAFillRectBatch.cpp index cc89d03870..0e66134795 100644 --- a/src/gpu/batches/GrNonAAFillRectBatch.cpp +++ b/src/gpu/batches/GrNonAAFillRectBatch.cpp @@ -107,6 +107,7 @@ public: i, info.fColor, info.fRect.fLeft, info.fRect.fTop, info.fRect.fRight, info.fRect.fBottom); } + str.append(DumpPipelineInfo(*this->pipeline())); str.append(INHERITED::dumpInfo()); return str; } diff --git a/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp b/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp index 0652580aa2..9a946c80f6 100644 --- a/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp +++ b/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp @@ -125,6 +125,7 @@ public: i, geo.fColor, geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect.fBottom); } + str.append(DumpPipelineInfo(*this->pipeline())); str.append(INHERITED::dumpInfo()); return str; } diff --git a/src/gpu/batches/GrNonAAStrokeRectBatch.cpp b/src/gpu/batches/GrNonAAStrokeRectBatch.cpp index f443b32f19..9139dab9fe 100644 --- a/src/gpu/batches/GrNonAAStrokeRectBatch.cpp +++ b/src/gpu/batches/GrNonAAStrokeRectBatch.cpp @@ -51,6 +51,17 @@ public: const char* name() const override { return "NonAAStrokeRectBatch"; } + SkString dumpInfo() const override { + SkString string; + string.appendf("Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], " + "StrokeWidth: %.2f\n", + fColor, fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom, + fStrokeWidth); + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { diff --git a/src/gpu/batches/GrPLSPathRenderer.cpp b/src/gpu/batches/GrPLSPathRenderer.cpp index a41e1401ca..f31c323581 100644 --- a/src/gpu/batches/GrPLSPathRenderer.cpp +++ b/src/gpu/batches/GrPLSPathRenderer.cpp @@ -778,6 +778,14 @@ public: const char* name() const override { return "PLSBatch"; } + SkString dumpInfo() const override { + SkString string; + string.printf("Color 0x%08x, UsesLocalCoords: %d\n", fColor, fUsesLocalCoords); + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { @@ -927,8 +935,7 @@ bool GrPLSPathRenderer::onDrawPath(const DrawPathArgs& args) { SkPath path; args.fShape->asPath(&path); - sk_sp batch(new PLSPathBatch(args.fPaint->getColor(), - path, *args.fViewMatrix)); + sk_sp batch(new PLSPathBatch(args.fPaint->getColor(), path, *args.fViewMatrix)); GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fRenderTargetContext->mustUseHWAA(*args.fPaint)); diff --git a/src/gpu/batches/GrRegionBatch.cpp b/src/gpu/batches/GrRegionBatch.cpp index 47b6f6777d..ae09a5f290 100644 --- a/src/gpu/batches/GrRegionBatch.cpp +++ b/src/gpu/batches/GrRegionBatch.cpp @@ -76,6 +76,7 @@ public: str.appendf("%d: Color: 0x%08x, Region with %d rects\n", i, info.fColor, info.fRegion.computeRegionComplexity()); } + str.append(DumpPipelineInfo(*this->pipeline())); str.append(INHERITED::dumpInfo()); return str; } diff --git a/src/gpu/batches/GrShadowRRectBatch.cpp b/src/gpu/batches/GrShadowRRectBatch.cpp index 08f7e86952..c4b56b8e18 100755 --- a/src/gpu/batches/GrShadowRRectBatch.cpp +++ b/src/gpu/batches/GrShadowRRectBatch.cpp @@ -143,6 +143,7 @@ public: fGeoData[i].fOuterRadius, fGeoData[i].fInnerRadius, fGeoData[i].fBlurRadius); } + string.append(DumpPipelineInfo(*this->pipeline())); string.append(INHERITED::dumpInfo()); return string; } @@ -574,6 +575,7 @@ public: fGeoData[i].fOuterRadius, fGeoData[i].fInnerRadius, fGeoData[i].fBlurRadius); } + string.append(DumpPipelineInfo(*this->pipeline())); string.append(INHERITED::dumpInfo()); return string; } diff --git a/src/gpu/batches/GrTessellatingPathRenderer.cpp b/src/gpu/batches/GrTessellatingPathRenderer.cpp index 8e17ea4f61..970af5cd5c 100644 --- a/src/gpu/batches/GrTessellatingPathRenderer.cpp +++ b/src/gpu/batches/GrTessellatingPathRenderer.cpp @@ -174,6 +174,14 @@ public: const char* name() const override { return "TessellatingPathBatch"; } + SkString dumpInfo() const override { + SkString string; + string.appendf("Color 0x%08x, aa: %d\n", fColor, fAntiAlias); + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp index 669e604725..d9cb72f192 100644 --- a/src/gpu/effects/GrDashingEffect.cpp +++ b/src/gpu/effects/GrDashingEffect.cpp @@ -260,6 +260,23 @@ public: const char* name() const override { return "DashBatch"; } + SkString dumpInfo() const override { + SkString string; + for (const auto& geo : fGeoData) { + string.appendf("Pt0: [%.2f, %.2f], Pt1: [%.2f, %.2f], Width: %.2f, Ival0: %.2f, " + "Ival1 : %.2f, Phase: %.2f\n", + geo.fPtsRot[0].fX, geo.fPtsRot[0].fY, + geo.fPtsRot[1].fX, geo.fPtsRot[1].fY, + geo.fSrcStrokeWidth, + geo.fIntervals[0], + geo.fIntervals[1], + geo.fPhase); + } + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + void computePipelineOptimizations(GrInitInvariantOutput* color, GrInitInvariantOutput* coverage, GrBatchToXPOverrides* overrides) const override { diff --git a/src/gpu/instanced/InstancedRendering.h b/src/gpu/instanced/InstancedRendering.h index 97d6e1963d..faa5471f44 100644 --- a/src/gpu/instanced/InstancedRendering.h +++ b/src/gpu/instanced/InstancedRendering.h @@ -100,6 +100,25 @@ protected: ~Batch() override; const char* name() const override { return "Instanced Batch"; } + SkString dumpInfo() const override { + SkString string; + string.printf("AA: %d, ShapeTypes: 0x%02x, IShapeTypes: 0x%02x, Persp %d, " + "NonSquare: %d, PLoad: %0.2f, Tracked: %d, NumDraws: %d, " + "GeomChanges: %d\n", + (int)fInfo.fAntialiasMode, + fInfo.fShapeTypes, + fInfo.fInnerShapeTypes, + fInfo.fHasPerspective, + fInfo.fNonSquare, + fPixelLoad, + fIsTracked, + fNumDraws, + fNumChangesInGeometry); + string.append(DumpPipelineInfo(*this->pipeline())); + string.append(INHERITED::dumpInfo()); + return string; + } + struct Draw { Instance fInstance; IndexRange fGeometry; -- 2.34.1