From 7c3e7180948766321c51d165737555e78910de51 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Thu, 1 Dec 2016 09:35:30 -0500 Subject: 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/batches/GrDrawBatch.h | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'src/gpu/batches/GrDrawBatch.h') 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()); -- cgit v1.2.3