diff options
author | 2016-12-01 09:35:30 -0500 | |
---|---|---|
committer | 2016-12-01 15:07:31 +0000 | |
commit | 7c3e7180948766321c51d165737555e78910de51 (patch) | |
tree | ab6c72364dfcd10b020e6f6a1382af62ede7d0c4 /src/gpu/batches | |
parent | 1c038af278a69186e988dd9348b4089d78759492 (diff) |
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 <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/batches')
22 files changed, 157 insertions, 20 deletions
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("<disabled>\n"); } - string.append(INHERITED::dumpInfo()); - return string; } -protected: const GrPipeline* pipeline() const { SkASSERT(fPipelineInstalled); return reinterpret_cast<const GrPipeline*>(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<GrDrawBatch> batch(new PLSPathBatch(args.fPaint->getColor(), - path, *args.fViewMatrix)); + sk_sp<GrDrawBatch> 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 { |